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 #129993

Closed
wants to merge 47 commits into from

Commits on Jul 7, 2024

  1. Call the target libdir target libdir

    Because it's the target libdir.
    
    `--print` uses the same terminology, and it's a simple way to make it
    obviously different from `$sysroot/lib`.
    Noratrieb committed Jul 7, 2024
    Configuration menu
    Copy the full SHA
    7627a54 View commit details
    Browse the repository at this point in the history

Commits on Aug 9, 2024

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

Commits on Aug 29, 2024

  1. Remove the 'body lifetime on FilterInformation.

    It's not needed.
    nnethercote committed Aug 29, 2024
    Configuration menu
    Copy the full SHA
    c6111c0 View commit details
    Browse the repository at this point in the history
  2. Move WriteInfo out of Allocations.

    It doesn't need to be in there, and the move simplifies lifetimes.
    nnethercote committed Aug 29, 2024
    Configuration menu
    Copy the full SHA
    0a282ea View commit details
    Browse the repository at this point in the history
  3. Remove Allocations.

    It's not necessary, and just complicates things.
    nnethercote committed Aug 29, 2024
    Configuration menu
    Copy the full SHA
    ad5a6e1 View commit details
    Browse the repository at this point in the history
  4. Simplify Candidate.

    By making it own the index maps, instead of holding references to them.
    This requires moving the free function `find_candidate` into
    `Candidate::reset_and_find`. It lets the `'alloc` lifetime be removed
    everywhere that still has it.
    nnethercote committed Aug 29, 2024
    Configuration menu
    Copy the full SHA
    1be2204 View commit details
    Browse the repository at this point in the history

Commits on Aug 30, 2024

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

Commits on Sep 1, 2024

  1. Configuration menu
    Copy the full SHA
    5afc461 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    84259ff View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    35a7c1b View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    dd5f7bc View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    4825fb1 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    5a85632 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    01d8235 View commit details
    Browse the repository at this point in the history

Commits on Sep 2, 2024

  1. Configuration menu
    Copy the full SHA
    e3af6dc View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    55bc638 View commit details
    Browse the repository at this point in the history

Commits on Sep 3, 2024

  1. Configuration menu
    Copy the full SHA
    65e78db View commit details
    Browse the repository at this point in the history
  2. Update marker.rs

    chancancode authored Sep 3, 2024
    Configuration menu
    Copy the full SHA
    3626b66 View commit details
    Browse the repository at this point in the history
  3. Update marker.rs

    chancancode authored Sep 3, 2024
    Configuration menu
    Copy the full SHA
    efc20de View commit details
    Browse the repository at this point in the history
  4. Update marker.rs

    chancancode authored Sep 3, 2024
    Configuration menu
    Copy the full SHA
    277a08c View commit details
    Browse the repository at this point in the history
  5. Update marker.rs

    chancancode authored Sep 3, 2024
    Configuration menu
    Copy the full SHA
    e45b53e View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    7157f98 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    a4f2a31 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    5525043 View commit details
    Browse the repository at this point in the history

Commits on Sep 4, 2024

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

Commits on Sep 5, 2024

  1. run_make_support: rename Command::stdin to stdin_buf and add `std…

    …{in,out,err}` config helpers
    
    Previously `Command::stdin` was actually just a stdin buffer helper, but
    this is different from `std::process::Command::stdin`. This is
    needlessly confusing, and blocks support to add `std{in,out,err}` config
    that tests may want to use to e.g. redirect to `/dev/ptmx`.
    jieyouxu committed Sep 5, 2024
    Configuration menu
    Copy the full SHA
    2031eac View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    afed862 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    8871ce0 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    a459403 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    f96aff9 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    1884983 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    d059f37 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    238944c View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    8f9c4b3 View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    f8f4d50 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    7064135 View commit details
    Browse the repository at this point in the history
  12. Review comments

    compiler-errors committed Sep 5, 2024
    Configuration menu
    Copy the full SHA
    c1d0410 View commit details
    Browse the repository at this point in the history
  13. Rollup merge of rust-lang#126136 - Noratrieb:bootstrap-naming, r=onur…

    …-ozkan
    
    Call the target libdir target libdir
    
    Because it's the target libdir.
    
    `--print` uses the same terminology, and it's a simple way to make it obviously different from `$sysroot/lib`.
    matthiaskrgr authored Sep 5, 2024
    Configuration menu
    Copy the full SHA
    b514f52 View commit details
    Browse the repository at this point in the history
  14. Rollup merge of rust-lang#128820 - LYF1999:yf/dev, r=nikic

    fix: get llvm type of global val
    
    using `LLVMTypeOf` on a global var always return ptr. so create a new function to access the value type of a global
    matthiaskrgr authored Sep 5, 2024
    Configuration menu
    Copy the full SHA
    9039bcf View commit details
    Browse the repository at this point in the history
  15. Rollup merge of rust-lang#129028 - compiler-errors:contra, r=lcnr

    `impl_trait_overcaptures`: Don't worry about uncaptured contravariant lifetimes if they outlive a captured lifetime
    
    **NOTE:** Review only the first commit carefully. The second one is just moving stuff around, so you can turn whitespace off for that one.
    
    This PR relaxes the `impl_trait_overcaptures` lint to not fire in cases like:
    
    ```rust
    struct Ctxt<'tcx>(&'tcx ());
    
    impl<'tcx> Ctxt<'tcx> {
        fn compute(&self) -> impl Sized + '_ { }
    }
    ```
    
    Specifically, the lint will not fire if **all** overcaptured regions (i.e. those which will be captured in edition 2024, which are not captured today) **satisfy**:
    * The region is contravariant (or bivariant) in the function signature
    * The region outlives some other region which is captured by the opaque
    
    ### The idea behind this
    
    Why is this OK? My reasoning is that since the region is contravariant in the function signature, we know that it can be shortened arbitrarily at the call site. And specifically, we know it can be shortened to be equal to one of the regions that it outlives -- that's why we need to prove that it outlives some other region that *is* captured.
    
    We could technically relax this further, but there would be (IMO somewhat easy) cases to make this a false negative in real code. For example, if the region is invariant, then we can hit issues like:
    
    ```rust
    struct Ctxt<'tcx>(&'tcx mut &'tcx mut ());
    
    impl<'tcx> Ctxt<'tcx> {
        fn compute(&self) -> impl Sized + use<'_, 'tcx> { }
        // We use `use<'_, 'tcx>` to show what happens in edition 2024
    }
    
    fn test<'a, 'b>(x: &'a Ctxt<'b>, y: &'a Ctxt<'a>) {
        let results = [x.compute(), y.compute()];
        //~^ ERROR lifetime may not live long enough
        // Since both opaques now capture `'tcx`, this enforces that `'a == 'b`.
    }
    ```
    
    ### Is this actually totally fine?
    
    There's one case where users might still hit issues, and it's if we turbofish lifetimes directly:
    
    ```rust
    struct Ctxt<'tcx>(&'tcx ());
    
    impl<'tcx> Ctxt<'tcx> {
        fn compute(&self) -> impl Sized + use<'_, 'tcx> { }
    }
    
    fn test<'a, 'b>(x: &'a Ctxt<'b>, y: &'a Ctxt<'a>) {
        let results = [Ctxt::<'b>::compute(x), Ctxt::<'a>::compute(y)];
        //~^ ERROR lifetime may not live long enough
        // Since both opaques now capture `'tcx`, this enforces that `'a == 'b`.
        // Note that we don't shorten `'b` to `'a` since we turbofished it.
    }
    ```
    
    ### Well... we should still warn?
    
    I kinda don't care about this case, though I guess we could possibly downgrade the lint to something like `IMPL_TRAIT_OVERCAPTURES_STRICT` instead of suppressing it altogether. Thoughts? If we were to do this, then I'd probably also opt to include the invariant case in `IMPL_TRAIT_OVERCAPTURES_STRICT` and move it out of `IMPL_TRAIT_OVERCAPTURES`.
    matthiaskrgr authored Sep 5, 2024
    Configuration menu
    Copy the full SHA
    8f396e0 View commit details
    Browse the repository at this point in the history
  16. Rollup merge of rust-lang#129471 - GuillaumeGomez:sort-impl-associate…

    …d-items, r=t-rustdoc-frontend
    
    [rustdoc] Sort impl associated items by kinds and then by appearance
    
    Following [this zulip discussion](https://rust-lang.zulipchat.com/#narrow/stream/266220-t-rustdoc/topic/.22Freeze.22.20order.20of.20items.20in.20.28trait.29.20impls.3F), I implemented it.
    
    This brings the following change: impl associated items will now be grouped by kind and will now be first sorted by kind and then by the order they are declared in the source code (like currently).
    
    The kinds are sorted in the following order:
    1. Constants
    2. Types
    3. Functions
    
    The reason behind this order is that associated constants can be used in associated types (like length in arrays) and both associated types and associated constants can be used in associated functions. So if an associated item from the same impl is used, its definition will always be above where it's being used.
    
    cc `@camelid`
    r? `@notriddle`
    matthiaskrgr authored Sep 5, 2024
    Configuration menu
    Copy the full SHA
    36f4539 View commit details
    Browse the repository at this point in the history
  17. Rollup merge of rust-lang#129706 - compiler-errors:scratch, r=estebank

    Rename dump of coroutine by-move-body to be more consistent, fix ICE in dump_mir
    
    First, we add a missing match for `DefKind::SyntheticCoroutineBody` in `dump_mir`. Fixes rust-lang#129703. The second commit (directly below) serves as a test.
    
    Second, we reorder the `dump_mir` in `coroutine_by_move_body_def_id` to be *after* we adjust the body source, and change the disambiguator so it reads more like any other MIR body. This also serves as a test for the ICE, since we're dumping the MIR of a body with `DefKind::SyntheticCoroutineBody`.
    
    Third, we change the parenting of the synthetic MIR body to have the *coroutine-closure* (i.e. async closure) as its parent, so we don't have long strings of `{closure#0}-{closure#0}-{closure#0}`.
    
    try-job: test-various
    matthiaskrgr authored Sep 5, 2024
    Configuration menu
    Copy the full SHA
    41ce7a9 View commit details
    Browse the repository at this point in the history
  18. Rollup merge of rust-lang#129720 - nnethercote:simplify-dest_prop-mm,…

    … r=cjgillot
    
    Simplify DestProp memory management
    
    The DestProp MIR pass has some convoluted memory management. This PR simplifies it.
    
    r? ``@davidtwco``
    matthiaskrgr authored Sep 5, 2024
    Configuration menu
    Copy the full SHA
    e590201 View commit details
    Browse the repository at this point in the history
  19. Rollup merge of rust-lang#129796 - GuillaumeGomez:unify-code-examples…

    …, r=notriddle
    
    Unify scraped examples with other code examples
    
    Fixes rust-lang#129763.
    
    This first PR both fixes rust-lang#129763 but also unifies buttons display for code examples:
    
    ![image](https://github.com/user-attachments/assets/c8475945-dcc3-4c25-8d7d-1659f85301c8)
    
    You can test it [here](https://rustdoc.crud.net/imperio/unify-code-examples/doc/scrape_examples/fn.test.html) and [here](https://rustdoc.crud.net/imperio/unify-code-examples/doc/scrape_examples/fn.test_many.html).
    
    I'm planning to send a follow-up to make the buttons generated in JS directly (or I can do it in this PR directly if you prefer).
    
    cc ``@willcrichton``
    r? ``@notriddle``
    matthiaskrgr authored Sep 5, 2024
    Configuration menu
    Copy the full SHA
    3f99c12 View commit details
    Browse the repository at this point in the history
  20. Rollup merge of rust-lang#129938 - chancancode:patch-1, r=thomcc

    Elaborate on deriving vs implementing `Copy`
    
    I was reading this documentation and this wasn't immediately clear to me.
    
    In my mind, it seemed obvious that a type can only claim to be `Copy` if the bits it is storing can be `Copy`, and in the case of a generic struct that can only be the case if `T: Copy`. So the bound added by the derive seemed necessary at all times, and I thought what the documentation was trying to say is that the custom implementation allows you to add _additional bounds_.
    
    Of course what it was actually trying to point out is that just because you have a generic parameter `T`, it doesn't necessarily mean you are storing the bits of `T`. And if you aren't, it may be the case that your own bits can be copied regardless of whether the bits of `T` can be safely copied.
    
    Thought it may be worth elaborating to make that a bit more clear. Haven't tested/didn't try to figure out how to render this locally. Mainly not sure if the `PhantomData` back link is going to just work or need some extra stuff, but I figured someone else probably could just tell.
    matthiaskrgr authored Sep 5, 2024
    Configuration menu
    Copy the full SHA
    86bd866 View commit details
    Browse the repository at this point in the history
  21. Rollup merge of rust-lang#129973 - jieyouxu:rework-rmake-stdio, r=Kobzol

    run_make_support: rename `Command::stdin` to `stdin_buf` and add `std{in,out,err}` config helpers
    
    Previously `Command::stdin` was actually just a stdin buffer helper, but
    this is different from `std::process::Command::stdin`. This is
    needlessly confusing, and blocks support to add `std{in,out,err}` config
    helpers that tests may want to use to e.g. redirect to `/dev/ptmx`.
    matthiaskrgr authored Sep 5, 2024
    Configuration menu
    Copy the full SHA
    0be10be View commit details
    Browse the repository at this point in the history