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 8 pull requests #130461

Closed
wants to merge 32 commits into from

Commits on Aug 11, 2024

  1. Configuration menu
    Copy the full SHA
    6360287 View commit details
    Browse the repository at this point in the history
  2. Update expectations

    GKFX committed Aug 11, 2024
    Configuration menu
    Copy the full SHA
    ae75a9b View commit details
    Browse the repository at this point in the history

Commits on Aug 28, 2024

  1. add new_cyclic_in for rc

    Matthew Giordano committed Aug 28, 2024
    Configuration menu
    Copy the full SHA
    13e36cf View commit details
    Browse the repository at this point in the history

Commits on Aug 29, 2024

  1. fix fmt

    Matthew Giordano committed Aug 29, 2024
    Configuration menu
    Copy the full SHA
    21cb847 View commit details
    Browse the repository at this point in the history
  2. fix new_cyclic_in for rc

    Matthew Giordano committed Aug 29, 2024
    Configuration menu
    Copy the full SHA
    4abb8e2 View commit details
    Browse the repository at this point in the history
  3. improve comments

    Matthew Giordano committed Aug 29, 2024
    Configuration menu
    Copy the full SHA
    2383cc9 View commit details
    Browse the repository at this point in the history
  4. add new_cyclic_in for Arc

    Matthew Giordano committed Aug 29, 2024
    Configuration menu
    Copy the full SHA
    68169d3 View commit details
    Browse the repository at this point in the history

Commits on Sep 6, 2024

  1. remove the Clone requirement

    Matthew Giordano committed Sep 6, 2024
    Configuration menu
    Copy the full SHA
    97df334 View commit details
    Browse the repository at this point in the history
  2. Remove duplicate impl

    Matthew Giordano committed Sep 6, 2024
    Configuration menu
    Copy the full SHA
    550e55f View commit details
    Browse the repository at this point in the history

Commits on Sep 12, 2024

  1. Don't call extern_crate when local crate name is the same as a depend…

    …ency and we have a trait error
    compiler-errors committed Sep 12, 2024
    Configuration menu
    Copy the full SHA
    9d5d03b View commit details
    Browse the repository at this point in the history

Commits on Sep 16, 2024

  1. Configuration menu
    Copy the full SHA
    05483d5 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    6e982f5 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    062ff4d View commit details
    Browse the repository at this point in the history

Commits on Sep 17, 2024

  1. Configuration menu
    Copy the full SHA
    af1ca77 View commit details
    Browse the repository at this point in the history
  2. Update library/alloc/src/sync.rs

    Co-authored-by: David Tolnay <dtolnay@gmail.com>
    matthewpipie and dtolnay committed Sep 17, 2024
    Configuration menu
    Copy the full SHA
    6750f04 View commit details
    Browse the repository at this point in the history
  3. tests: allow trunc/select instructions to be missing

    On LLVM 20, these instructions already get eliminated, which at least
    partially satisfies a TODO. I'm not talented enough at using FileCheck
    to try and constrain this further, but if we really want to we could
    copy an LLVM 20 specific version of this test that would restore it to
    being CHECK-NEXT: insertvalue ...
    
    @rustbot label: +llvm-main
    durin42 committed Sep 17, 2024
    Configuration menu
    Copy the full SHA
    978f10d View commit details
    Browse the repository at this point in the history
  4. Fix a couple more DefKind discrepancies between DefKind::Closure and …

    …DefKind::SyntheticCoroutineBody
    compiler-errors committed Sep 17, 2024
    Configuration menu
    Copy the full SHA
    4beb1cf View commit details
    Browse the repository at this point in the history
  5. Minimize visibilities.

    This makes it much clearer which things are used outside the crate.
    nnethercote committed Sep 17, 2024
    Configuration menu
    Copy the full SHA
    bdacdfe View commit details
    Browse the repository at this point in the history
  6. Clean up formatting.

    Reflow overly long comments, plus some minor whitespace improvements.
    nnethercote committed Sep 17, 2024
    Configuration menu
    Copy the full SHA
    cd3da00 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    52c5de0 View commit details
    Browse the repository at this point in the history
  8. Remove unnecessary cx argument.

    Because `bx` contains a `cx`.
    nnethercote committed Sep 17, 2024
    Configuration menu
    Copy the full SHA
    b3b56d8 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    ae1f092 View commit details
    Browse the repository at this point in the history
  10. Rename some lifetimes.

    `'mir` is not a good lifetime name in `LocalAnalyzer`, because it's used
    on two unrelated fields. `'a` is more standard for a situation like this
    (e.g. rust-lang#130022).
    nnethercote committed Sep 17, 2024
    Configuration menu
    Copy the full SHA
    3ec2f12 View commit details
    Browse the repository at this point in the history
  11. Merge some impl blocks.

    nnethercote committed Sep 17, 2024
    Configuration menu
    Copy the full SHA
    c629538 View commit details
    Browse the repository at this point in the history
  12. Rollup merge of rust-lang#128961 - GKFX:issue-128930-explain-missing-…

    …option, r=jieyouxu
    
    Fix rust-lang#128930: Print documentation of CLI options missing their arg
    
    Fix rust-lang#128930. Failing to give an argument to CLI options which require it now prints something like:
    ```
    $ rustc --print
    error: Argument to option 'print' missing
           Usage:
               --print [crate-name|file-names|sysroot|target-libdir|cfg|check-cfg|calling-conventions|target-list|target-cpus|target-features|relocation-models|code-models|tls-models|target-spec-json|all-target-specs-json|native-static-libs|stack-protector-strategies|link-args|deployment-target]
                                   Compiler information to print on stdout
    ```
    fee1-dead committed Sep 17, 2024
    Configuration menu
    Copy the full SHA
    9b91d67 View commit details
    Browse the repository at this point in the history
  13. Rollup merge of rust-lang#129073 - compiler-errors:receiver-variance,…

    … r=lcnr
    
    Relate receiver invariantly in method probe for `Mode::Path`
    
    Effectively reverts part of rust-lang#126128
    Fixes rust-lang#126227
    
    This PR changes method probing to use equality for fully path-based method lookup, and subtyping for receiver `.` method lookup.
    
    r? lcnr
    fee1-dead committed Sep 17, 2024
    Configuration menu
    Copy the full SHA
    1f1beb6 View commit details
    Browse the repository at this point in the history
  14. Rollup merge of rust-lang#129674 - matthewpipie:rc-arc-new-cyclic-in,…

    … r=dtolnay
    
    Add new_cyclic_in for Rc and Arc
    
    Currently, new_cyclic_in does not exist for Rc and Arc. This is an oversight according to rust-lang/wg-allocators#132.
    
    This PR adds new_cyclic_in for Rc and Arc. The implementation is almost the exact same as new_cyclic with some small differences to make it allocator-specific. new_cyclic's implementation has been replaced with a call to `new_cyclic_in(data_fn, Global)`.
    
    Remaining questions:
    * ~~Is requiring Allocator to be Clone OK? According to rust-lang/wg-allocators#88, Allocators should be cheap to clone. I'm just hesitant to add unnecessary constraints, though I don't see an obvious workaround for this function since many called functions in new_cyclic_in expect an owned Allocator. I see Allocator.by_ref() as an option, but that doesn't work on when creating Weak { ptr: init_ptr, alloc: alloc.clone() }, because the type of Weak then becomes Weak<T, &A> which is incompatible.~~ Fixed, thank you `@zakarumych!` This PR no longer requires the allocator to be Clone.
    * Currently, new_cyclic_in's documentation is almost entirely copy-pasted from new_cyclic, with minor tweaks to make it more accurate (e.g. Rc<T> -> Rc<T, A>). The example section is removed to mitigate redundancy and instead redirects to cyclic_in. Is this appropriate?
    * ~~The comments in new_cyclic_in (and much of the implementation) are also copy-pasted from new_cyclic. Would it be better to make a helper method new_cyclic_in_internal that both functions call, with either Global or the custom allocator? I'm not sure if that's even possible, since the internal method would have to return Arc<T, Global> and I don't know if it's possible to "downcast" that to an Arc<T>. Maybe transmute would work here?~~ Done, thanks `@zakarumych`
    * Arc::new_cyclic is #[inline], but Rc::new_cyclic is not. Which is preferred?
    * nit: does it matter where in the impl block new_cyclic_in is defined?
    fee1-dead committed Sep 17, 2024
    Configuration menu
    Copy the full SHA
    5385303 View commit details
    Browse the repository at this point in the history
  15. Rollup merge of rust-lang#130201 - compiler-errors:foreign-synthetic-…

    …body, r=lcnr
    
    Encode `coroutine_by_move_body_def_id` in crate metadata
    
    We synthesize the MIR for a by-move body for the `FnOnce` implementation of async closures. It can be accessed with the `coroutine_by_move_body_def_id` query. We weren't encoding this query in the metadata though, nor were we properly recording that synthetic MIR in `mir_keys`, so the `optimized_mir` wasn't getting encoded either!
    
    Stacked on top is a fix to consider `DefKind::SyntheticCoroutineBody` to return true in several places I missed. Specifically, we should consider the def-kind in `fn DefKind::is_fn_like()`, since that's what we were using to make sure we ensure `query mir_inliner_callees` before the MIR gets stolen for the body. This led to some CI failures that were caught by miri but which I added a test for.
    fee1-dead committed Sep 17, 2024
    Configuration menu
    Copy the full SHA
    8a5f499 View commit details
    Browse the repository at this point in the history
  16. Rollup merge of rust-lang#130275 - compiler-errors:extern-crate, r=lcnr

    Don't call `extern_crate` when local crate name is the same as a dependency and we have a trait error
    
    rust-lang#124944 implemented logic to point out when a trait bound failure involves a *trait* and *type* who come from identically named but different crates. This logic calls the `extern_crate` query which is not valid on `LOCAL_CRATE` cnum, so let's filter that out eagerly.
    
    Fixes rust-lang#130272
    Fixes rust-lang#129184
    fee1-dead committed Sep 17, 2024
    Configuration menu
    Copy the full SHA
    4922280 View commit details
    Browse the repository at this point in the history
  17. Rollup merge of rust-lang#130440 - compiler-errors:rpitit-opaque-hidd…

    …en, r=jieyouxu
    
    Don't ICE in `opaque_hidden_inferred_bound` lint for RPITIT in trait with no default method body
    
    Inline comment should explain the fix.
    
    Fixes rust-lang#130422
    fee1-dead committed Sep 17, 2024
    Configuration menu
    Copy the full SHA
    4a9fbc3 View commit details
    Browse the repository at this point in the history
  18. Rollup merge of rust-lang#130454 - durin42:llvm-20-notrunc, r=working…

    …jubilee
    
    tests: allow trunc/select instructions to be missing
    
    On LLVM 20, these instructions already get eliminated, which at least partially satisfies a TODO. I'm not talented enough at using FileCheck to try and constrain this further, but if we really want to we could copy an LLVM 20 specific version of this test that would restore it to being CHECK-NEXT: insertvalue ...
    
    `@rustbot` label: +llvm-main
    r? `@DianQK`
    fee1-dead committed Sep 17, 2024
    Configuration menu
    Copy the full SHA
    50a8de3 View commit details
    Browse the repository at this point in the history
  19. Rollup merge of rust-lang#130458 - nnethercote:rustc_codegen_ssa-clea…

    …nups, r=jieyouxu
    
    `rustc_codegen_ssa` cleanups
    
    Just some minor improvements I found while reading through this code.
    
    r? `@jieyouxu`
    fee1-dead committed Sep 17, 2024
    Configuration menu
    Copy the full SHA
    50fd6ce View commit details
    Browse the repository at this point in the history