Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 9 pull requests #98612

Merged
merged 27 commits into from
Jun 28, 2022
Merged

Rollup of 9 pull requests #98612

merged 27 commits into from
Jun 28, 2022

Commits on Jun 19, 2022

  1. Configuration menu
    Copy the full SHA
    4c4152b View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    e251247 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    ffb593b View commit details
    Browse the repository at this point in the history

Commits on Jun 21, 2022

  1. Configuration menu
    Copy the full SHA
    a0eba66 View commit details
    Browse the repository at this point in the history

Commits on Jun 22, 2022

  1. Configuration menu
    Copy the full SHA
    c416307 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    6587dda View commit details
    Browse the repository at this point in the history

Commits on Jun 26, 2022

  1. Configuration menu
    Copy the full SHA
    f954f7b View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    0c88602 View commit details
    Browse the repository at this point in the history

Commits on Jun 27, 2022

  1. lint: fix condition in diagnostic lints

    Unfortunately, the diagnostic lints are very broken and trigger much
    more often than they should. Correct the conditional which checks if the
    function call being made is to a diagnostic function so that it returns
    in every intended case.
    
    Signed-off-by: David Wood <david.wood@huawei.com>
    davidtwco committed Jun 27, 2022
    Configuration menu
    Copy the full SHA
    871c879 View commit details
    Browse the repository at this point in the history
  2. various: add rustc_lint_diagnostics to diag fns

    The `rustc_lint_diagnostics` attribute is used by the diagnostic
    translation/struct migration lints to identify calls where
    non-translatable diagnostics or diagnostics outwith impls are being
    created. Any function used in creating a diagnostic should be annotated
    with this attribute so this commit adds the attribute to many more
    functions.
    
    Signed-off-by: David Wood <david.wood@huawei.com>
    davidtwco committed Jun 27, 2022
    Configuration menu
    Copy the full SHA
    ae61224 View commit details
    Browse the repository at this point in the history
  3. privacy: port "field is private" diag

    Signed-off-by: David Wood <david.wood@huawei.com>
    davidtwco committed Jun 27, 2022
    Configuration menu
    Copy the full SHA
    be9ebfd View commit details
    Browse the repository at this point in the history
  4. privacy: port "item is private" diag

    Signed-off-by: David Wood <david.wood@huawei.com>
    davidtwco committed Jun 27, 2022
    Configuration menu
    Copy the full SHA
    cb90a4f View commit details
    Browse the repository at this point in the history
  5. privacy: port unnamed "item is private" diag

    Signed-off-by: David Wood <david.wood@huawei.com>
    davidtwco committed Jun 27, 2022
    Configuration menu
    Copy the full SHA
    0557d02 View commit details
    Browse the repository at this point in the history
  6. privacy: port "in public interface" diag

    Signed-off-by: David Wood <david.wood@huawei.com>
    davidtwco committed Jun 27, 2022
    Configuration menu
    Copy the full SHA
    74f3a96 View commit details
    Browse the repository at this point in the history
  7. privacy: deny diagnostic migration lints

    Signed-off-by: David Wood <david.wood@huawei.com>
    davidtwco committed Jun 27, 2022
    Configuration menu
    Copy the full SHA
    15d61d7 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    c24f063 View commit details
    Browse the repository at this point in the history
  9. Implement Send and Sync for ThinBox<T>

    Just like `Box<T>`, `ThinBox<T>` owns its data on the heap, so it should
    implement `Send` and `Sync` when `T` does.
    cuviper committed Jun 27, 2022
    Configuration menu
    Copy the full SHA
    6400736 View commit details
    Browse the repository at this point in the history
  10. Remove unstable CStr/CString change from 1.62 release note

    (Discovered in rust-lang#98571 (comment))
    
    The change to move CStr/CString to core/alloc is currently behind feature flags as stated in rust-lang#98314
    wwylele authored Jun 27, 2022
    Configuration menu
    Copy the full SHA
    f5a38d1 View commit details
    Browse the repository at this point in the history

Commits on Jun 28, 2022

  1. Rollup merge of rust-lang#97346 - JohnTitor:remove-back-compat-hacks,…

    … r=oli-obk
    
    Remove a back-compat hack on lazy TAIT
    
    This PR's motivation is here: rust-lang#72614 (comment)
    ~~But removing a hack doesn't seem to reject the code on the issue, there're some more hacks?~~
    r? ``@oli-obk``
    Dylan-DPC authored Jun 28, 2022
    Configuration menu
    Copy the full SHA
    c703d11 View commit details
    Browse the repository at this point in the history
  2. Rollup merge of rust-lang#98261 - WaffleLapkin:attempt_to_remove_max_…

    …suggestion_highlight_lines, r=flip1995
    
    Remove `MAX_SUGGESTION_HIGHLIGHT_LINES`
    
    After rust-lang#97798 the `MAX_SUGGESTION_HIGHLIGHT_LINES` constant doesn't really make sense since we always show full suggestions. This PR removes last usages of the constant and the constant itself.
    
    r? ``@flip1995`` (this mostly does changes in clippy)
    Dylan-DPC authored Jun 28, 2022
    Configuration menu
    Copy the full SHA
    9b3dbb8 View commit details
    Browse the repository at this point in the history
  3. Rollup merge of rust-lang#98337 - c410-f3r:assert-compiler, r=oli-obk

    [RFC 2011] Optimize non-consuming operators
    
    Tracking issue: rust-lang#44838
    Fifth step of rust-lang#96496
    
    The most non-invasive approach that will probably have very little to no performance impact.
    
    ## Current behaviour
    
    Captures are handled "on-the-fly", i.e., they are performed in the same place expressions are located.
    
    ```rust
    // `let a = 1; let b = 2; assert!(a > 1 && b < 100);`
    
    if !(
      { ***try capture `a` and then return `a`*** } > 1 && { ***try capture `b` and then return `b`*** } < 100
    ) {
      panic!( ... );
    }
    ```
    
    As such, some overhead is likely to occur (Specially with very large chains of conditions).
    
    ## New behaviour for non-consuming operators
    
    When an operator is known to not take `self`, then it is possible to capture variables **AFTER** the condition.
    
    ```rust
    // `let a = 1; let b = 2; assert!(a > 1 && b < 100);`
    
    if !( a > 1 && b < 100 ) {
      { ***try capture `a`*** }
      { ***try capture `b`*** }
      panic!( ... );
    }
    ```
    
    So the possible impact on the runtime execution time will be diminished.
    
    r? ````@oli-obk````
    Dylan-DPC authored Jun 28, 2022
    Configuration menu
    Copy the full SHA
    ec8477f View commit details
    Browse the repository at this point in the history
  4. Rollup merge of rust-lang#98384 - rdzhaafar:fix-macos-rss-reporting, …

    …r=davidtwco,michaelwoerister
    
    Fix RSS reporting on macOS
    
    > NOTE: This is a duplicate of rust-lang#98164, which I closed because I borked my rustc fork
    
    Currently, `rustc_data_structures::profiling::get_resident_set_size()` always returns `None` on macOS. This is because
    macOS does not implement procfs used in the unix version of the function:
    
    ```rust
    ...
    else if #[cfg(unix)] {
            pub fn get_resident_set_size() -> Option<usize> {
                let field = 1;
                let contents = fs::read("/proc/self/statm").ok()?;
                let contents = String::from_utf8(contents).ok()?;
                let s = contents.split_whitespace().nth(field)?;
                let npages = s.parse::<usize>().ok()?;
                Some(npages * 4096)
            }
    ...
    ```
    
    The proposed solution uses libproc, and more specifically `proc_pidinfo`, which has been available on macOS since 10.5 if the function signature inside libproc.h is to be believed:
    
    ```c
    int proc_pidinfo(int pid, int flavor, uint64_t arg, void *buffer, int buffersize) __OSX_AVAILABLE_STARTING(__MAC_10_5, __IPHONE_2_0);
    ```
    Dylan-DPC authored Jun 28, 2022
    Configuration menu
    Copy the full SHA
    56b7786 View commit details
    Browse the repository at this point in the history
  5. Rollup merge of rust-lang#98420 - davidtwco:translation-lint-fixes-an…

    …d-more-migration, r=compiler-errors
    
    translation: lint fix + more migration
    
    - Unfortunately, the diagnostic lints are very broken and trigger much more often than they should. This PR corrects the conditional which checks if the function call being made is to a diagnostic function so that it returns in every intended case.
    - The `rustc_lint_diagnostics` attribute is used by the diagnostic translation/struct migration lints to identify calls where non-translatable diagnostics or diagnostics outwith impls are being created. Any function used in creating a diagnostic should be annotated with this attribute so this PR adds the attribute to many more functions.
    - Port the diagnostics from the `rustc_privacy` crate and enable the lints for that crate.
    
    r? ``@compiler-errors``
    Dylan-DPC authored Jun 28, 2022
    Configuration menu
    Copy the full SHA
    400f435 View commit details
    Browse the repository at this point in the history
  6. Rollup merge of rust-lang#98430 - camsteffen:flatten-refactor, r=josh…

    …triplett
    
    Refactor iter adapters with less macros
    
    Just some code cleanup. Introduced a util `and_then_or_clear` for each of chain, flatten and fuse iter adapter impls. This reduces code nicely for flatten, but admittedly the other modules are more of a lateral move replacing macros with a function. But I think consistency across the modules and avoiding macros when possible is good.
    Dylan-DPC authored Jun 28, 2022
    Configuration menu
    Copy the full SHA
    ff223ff View commit details
    Browse the repository at this point in the history
  7. Rollup merge of rust-lang#98555 - mkroening:hermit-lock-init, r=m-ou-se

    Hermit: Fix initializing lazy locks
    
    Closes hermit-os/hermit-rs#322.
    
    The initialization function of hermit's `Condvar` is not called since rust-lang#97647 and was erroneously removed in rust-lang#97879.
    
    r? ``@m-ou-se``
    
    CC: ``@stlankes``
    Dylan-DPC authored Jun 28, 2022
    Configuration menu
    Copy the full SHA
    f181ae9 View commit details
    Browse the repository at this point in the history
  8. Rollup merge of rust-lang#98595 - cuviper:send-sync-thinbox, r=m-ou-se

    Implement `Send` and `Sync` for `ThinBox<T>`
    
    Just like `Box<T>`, `ThinBox<T>` owns its data on the heap, so it should
    implement `Send` and `Sync` when `T` does.
    
    This extends tracking issue rust-lang#92791.
    Dylan-DPC authored Jun 28, 2022
    Configuration menu
    Copy the full SHA
    e5b82de View commit details
    Browse the repository at this point in the history
  9. Rollup merge of rust-lang#98597 - wwylele:patch-1, r=Mark-Simulacrum

    Remove unstable CStr/CString change from 1.62 release note
    
    (Discovered in rust-lang#98571 (comment))
    
    The change to move CStr/CString to core/alloc is currently behind feature flags as stated in rust-lang#98314
    Dylan-DPC authored Jun 28, 2022
    Configuration menu
    Copy the full SHA
    66b8060 View commit details
    Browse the repository at this point in the history