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 7 pull requests #116408

Merged
merged 17 commits into from
Oct 4, 2023
Merged

Rollup of 7 pull requests #116408

merged 17 commits into from
Oct 4, 2023

Commits on Sep 19, 2023

  1. Replace 'mutex' with 'lock' in RwLock documentation

    When copying the documentation for `clear_poison` from Mutex, not every occurence of 'mutex' was replaced with 'lock'.
    Kriskras99 committed Sep 19, 2023
    Configuration menu
    Copy the full SHA
    cdf25c9 View commit details
    Browse the repository at this point in the history

Commits on Sep 25, 2023

  1. Configuration menu
    Copy the full SHA
    7bda9b1 View commit details
    Browse the repository at this point in the history
  2. update other place

    Milo123459 committed Sep 25, 2023
    Configuration menu
    Copy the full SHA
    221d0a6 View commit details
    Browse the repository at this point in the history

Commits on Oct 2, 2023

  1. Adapt todo! documentation to mention displaying custom values

    Correct hidden trait in doc test
    Colonial-Dev committed Oct 2, 2023
    Configuration menu
    Copy the full SHA
    f96cfb5 View commit details
    Browse the repository at this point in the history
  2. Appease tidy

    Colonial-Dev committed Oct 2, 2023
    Configuration menu
    Copy the full SHA
    0c6d279 View commit details
    Browse the repository at this point in the history

Commits on Oct 3, 2023

  1. Configuration menu
    Copy the full SHA
    67de150 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    ace85f0 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    f55c879 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    7815641 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    a18729c View commit details
    Browse the repository at this point in the history

Commits on Oct 4, 2023

  1. Rollup merge of rust-lang#115961 - Kriskras99:master, r=thomcc

    Replace 'mutex' with 'lock' in RwLock documentation
    
    When copying the documentation for `clear_poison` from Mutex, not every occurence of 'mutex' was replaced with 'lock'.
    matthiaskrgr committed Oct 4, 2023
    Configuration menu
    Copy the full SHA
    36e234a View commit details
    Browse the repository at this point in the history
  2. Rollup merge of rust-lang#116146 - Milo123459:milo/clarify-arg-docume…

    …ntation, r=thomcc
    
    Clarify `arg` and `args` documentation
    
    Fixes rust-lang#95400
    matthiaskrgr committed Oct 4, 2023
    Configuration menu
    Copy the full SHA
    d5bd019 View commit details
    Browse the repository at this point in the history
  3. Rollup merge of rust-lang#116363 - Colonial-Dev:issue-116130-fix, r=t…

    …homcc
    
    Adapt `todo!` documentation to mention displaying custom values
    
    Resolves rust-lang#116130.
    
    I copied from the [existing documentation](https://doc.rust-lang.org/std/macro.unimplemented.html) for `unimplemented!` more or less directly, down to the example trait used. I also took the liberty of fixing some formatting and typographical errors that I noticed.
    matthiaskrgr committed Oct 4, 2023
    Configuration menu
    Copy the full SHA
    0363cc5 View commit details
    Browse the repository at this point in the history
  4. Rollup merge of rust-lang#116365 - P1n3appl3:master, r=onur-ozkan

    bootstrap: make copying linker binaries conditional
    
    The change in rust-lang#116276 breaks bootstrapping if you don't use `lld` for linking with your stage0 compiler. Making this copy conditional should be enough to fix it.
    matthiaskrgr committed Oct 4, 2023
    Configuration menu
    Copy the full SHA
    e6a9bb1 View commit details
    Browse the repository at this point in the history
  5. Rollup merge of rust-lang#116388 - fmease:rustdoc-fix-n-clean-up-x-cr…

    …ate-higher-ranked-params, r=notriddle
    
    rustdoc: fix & clean up handling of cross-crate higher-ranked parameters
    
    Preparatory work for the refactoring planned in rust-lang#113015 (for correctness & maintainability).
    
    ---
    
    1. Render the higher-ranked parameters of cross-crate function pointer types **(*)**.
    2. Replace occurrences of `collect_referenced_late_bound_regions()` (CRLBR) with `bound_vars()`.
      The former is quite problematic and the use of the latter allows us to yank a lot of hacky code **(†)**
      as you can tell from the diff! :)
    3. Add support for cross-crate higher-ranked types (`#![feature(non_lifetime_binders)]`).
      We were previously ICE'ing on them (see `inline_cross/non_lifetime_binders.rs`).
    
    ---
    
    **(*)**: Extracted from test `inline_cross/fn-type.rs`:
    
    ```diff
    - fn(_: &'z fn(_: &'b str), _: &'a ()) -> &'a ()
    + for<'z, 'a, '_unused> fn(_: &'z for<'b> fn(_: &'b str), _: &'a ()) -> &'a ()
    ```
    
    **(†)**: It returns an `FxHashSet` which isn't *predictable* or *stable* wrt. source code (`.rmeta`) changes. To elaborate, the ordering of late-bound regions doesn't necessarily reflect the ordering found in the source code. It does seem to be stable across compilations but modifying the source code of the to-be-documented crates (like adding or renaming items) may result in a different order:
    
    <details><summary>Example</summary>
    
    Let's assume that we're documenting the cross-crate re-export of `produce` from the code below. On `master`, rustdoc would render the list of binders as `for<'x, 'y, 'z>`. However, once you add back the functions `a`–`l`, it would be rendered as `for<'z, 'y, 'x>` (reverse order)! Results may vary. `bound_vars()` fixes this as it returns them in source order.
    
    ```rs
    // pub fn a() {}
    // pub fn b() {}
    // pub fn c() {}
    // pub fn d() {}
    // pub fn e() {}
    // pub fn f() {}
    // pub fn g() {}
    // pub fn h() {}
    // pub fn i() {}
    // pub fn j() {}
    // pub fn k() {}
    // pub fn l() {}
    
    pub fn produce() -> impl for<'x, 'y, 'z> Trait<'z, 'y, 'x> {}
    
    pub trait Trait<'a, 'b, 'c> {}
    
    impl Trait<'_, '_, '_> for () {}
    ```
    
    </details>
    
    Further, as the name suggests, CRLBR only collects *referenced* regions and thus we drop unused binders. `bound_vars()` contains unused binders on the other hand. Let's stay closer to the source where possible and keep unused binders.
    
    Lastly, using `bound_vars()` allows us to get rid of
    
    * the deduplication and alphabetical sorting hack in `simplify.rs`
    * the weird field `bound_params` on `EqPredicate`
    
    both of which were introduced by me in rust-lang#102707 back when I didn't know better.
    
    To illustrate, let's look at the cross-crate bound `T: for<'a, 'b> Trait<A<'a> = (), B<'b> = ()>`.
    
    * With CRLBR + `EqPredicate.bound_params`, *before* bounds simplification we would have the bounds `T: Trait`, `for<'a> <T as Trait>::A<'a> == ()` and `for<'b> <T as Trait>::B<'b> == ()` which required us to merge `for<>`, `for<'a>` and `for<'b>` into `for<'a, 'b>` in a deterministic manner and without introducing duplicate binders.
    * With `bound_vars()`, we now have the bounds `for<'a, b> T: Trait`, `<T as Trait>::A<'a> == ()` and `<T as Trait>::B<'b> == ()` before bound simplification similar to rustc itself. This obviously no longer requires any funny merging of `for<>`s. On top of that `for<'a, 'b>` is guaranteed to be in source order.
    matthiaskrgr committed Oct 4, 2023
    Configuration menu
    Copy the full SHA
    3e29363 View commit details
    Browse the repository at this point in the history
  6. Rollup merge of rust-lang#116393 - compiler-errors:auto-bad, r=Waffle…

    …Lapkin
    
    Emit feature gate *warning* for `auto` traits pre-expansion
    
    Auto traits were introduced before we were more careful about not stabilizing new syntax pre-expansion.
    
    This is a more conservative step in the general direction we want to go in https://rust-lang.zulipchat.com/#narrow/stream/213817-t-lang/topic/Removal.20of.20.60auto.20trait.60.20syntax.
    
    Fixes rust-lang#116121
    matthiaskrgr committed Oct 4, 2023
    Configuration menu
    Copy the full SHA
    4ed2291 View commit details
    Browse the repository at this point in the history
  7. Rollup merge of rust-lang#116395 - WaffleLapkin:vacationize-waffle, r…

    …=lqd
    
    Mark myself as vacation or whatever
    
    I think I have the capacity to review PRs currently assigned to me, before vacation, but I won't be able to take any more. So, until everything settles down, I don't want to be assigned to new PRs.
    matthiaskrgr committed Oct 4, 2023
    Configuration menu
    Copy the full SHA
    d494048 View commit details
    Browse the repository at this point in the history