Skip to content

Rollup of 6 pull requests - #163718

Closed
JonathanBrouwer wants to merge 18 commits into
rust-lang:mainfrom
JonathanBrouwer:rollup-P8IwiBU
Closed

JonathanBrouwer wants to merge 18 commits into
rust-lang:mainfrom
JonathanBrouwer:rollup-P8IwiBU

Conversation

@JonathanBrouwer

Copy link
Copy Markdown
Member

Successful merges:

r? @ghost

Create a similar rollup

maxdexh and others added 18 commits September 25, 2026 18:02
…s` when using the `--generate-link-to-definition` feature
```
error: implementation of `TheTrait` is not general enough
  --> $DIR/associated-types-eq-hr.rs:96:5
   |
LL | fn tuple_one<T>()
   |    --------- due to a where-clause on `tuple_one`...
LL | where
LL |     T: for<'x, 'y> TheTrait<(&'x isize, &'y isize), A = &'x isize>,
   |        ----------------------------------------------------------- unsatisfied where-clause on `tuple_one`
...
LL |     tuple_one::<Tuple>();
   |     ^^^^^^^^^^^^^^^^^^^^
   |
   = note: ...`Tuple` must implement `TheTrait<(&'0 isize, &'1 isize)>`, for any two lifetimes `'0` and `'1`...
note: ...but it actually implements `TheTrait<(&'2 isize, &'2 isize)>`, for some specific lifetime `'2`
  --> $DIR/associated-types-eq-hr.rs:35:1
   |
LL | impl<'a> TheTrait<(&'a isize, &'a isize)> for Tuple {
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
```
Use a span note instead of span labels so that when talking about the trait that should have been implemented, we always point at where the obligation was introduced in a consistent place.

```
error: implementation of `TheTrait` is not general enough
  --> $DIR/associated-types-eq-hr.rs:96:5
   |
LL |     tuple_one::<Tuple>();
   |     ^^^^^^^^^^^^^^^^^^^^
   |
note: `Tuple` must implement `TheTrait<(&'0 isize, &'1 isize)>`, for any two lifetimes `'0` and `'1`...
  --> $DIR/associated-types-eq-hr.rs:59:8
   |
LL | fn tuple_one<T>()
   |    --------- due to a where-clause on `tuple_one`
LL | where
LL |     T: for<'x, 'y> TheTrait<(&'x isize, &'y isize), A = &'x isize>,
   |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unsatisfied where-clause on `tuple_one`
note: ...but it actually implements `TheTrait<(&'2 isize, &'2 isize)>`, for some specific lifetime `'2`
  --> $DIR/associated-types-eq-hr.rs:35:1
   |
LL | impl<'a> TheTrait<(&'a isize, &'a isize)> for Tuple {
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
```
```
error: implementation of `Lengthen` is not general enough
  --> $DIR/gat-bounds-not-checked-with-right-substitutions.rs:20:20
   |
LL |     type Gat<'a> = &'a str;
   |                    ^^^^^^^
   |
note: `Lengthen<&'0 str>` would have to be implemented for the type `&'a str`, for any lifetime `'0`...
  --> $DIR/gat-bounds-not-checked-with-right-substitutions.rs:12:19
   |
LL | trait Gat {
LL |     type Gat<'a>: for<'b> Lengthen<Self::Gat<'b>>;
   |                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Gat::Gat`
   = note: ...but `Lengthen<&'1 str>` is actually implemented for the type `&'1 str`, for some specific lifetime `'1`
```
…, r=nnethercote,RalfJung

implement FCW for `rustc_allowed_through_unstable_modules` items

Back in rust-lang#95956 we changed how stability checking of paths works, by checking the stability of all segments rather than just the last item in it. This meant that several items in the (unstable) `std::intrinsics` module, which were stable and re-exported elsewhere, could not be imported on stable anymore. By doing so, this broke everyone who imported (one example) `transmute` through `std::intrinsics::transmute` rather than `std::mem::transmute`.
To fix this regression, it also introduced the `rustc_allowed_through_unstable_modules` attribute, which is a hack to allow stable imports through unstable paths.

 We have been emitting the `deprecated` lint for this since Rust 1.86 (in rust-lang#136434).

A recent [crater run](rust-lang#157082) showed that many crates still depend on this accidental stabilization:
- 7859 total regressions
- 5k+ in old `rand-core` versions, new fixed minor versions released 3 weeks ago (after the crater run) in rust-random/rand_core#82 (comment)
- 600 from `trim-in-place`, which has a new major (but not minor) fixed version  (magiclen/trim-in-place#6)
- 600 from `wide`, has a fixed minor version (errors were in wide-0.7.32, fix is in 0.7.33)

Note however that the number of root regressions is very low (<100); almost all regressions are in (outdated) dependencies. The deprecation warnings have gotten people to fix their own code, but they cannot know about issues in their dependencies.

However, supporting this hack in the compiler significantly complicates the implementation of stability checking. Thus I'd really like to be able to get rid of this hack. That can't happen with so many regressions, but a step towards that is to start linting more aggressively on it.  This PR turns the lint into an FCW.

Tracking issue:  rust-lang#163160

Zulip thread: [#t-lang > fcwing on rustc_allowed_through_unstable_modules imports @ 💬](https://rust-lang.zulipchat.com/#narrow/channel/213817-t-lang/topic/fcwing.20on.20rustc_allowed_through_unstable_modules.20imports/near/620474117)

I don't know whose territory this is - adding new lints is lang's, but what library imports are valid is up to libs?
…athanBrouwer

Tweak the rendering of "not general enough" errors on the old trait solver

- Use a note to point at the source of the unmet obligation instead of labels (makes the order of the error consistent regardless of the order of the code)
- Point at the found impl that doesn't meet the obligation
- In a few cases, remove the same information being printed twice
- Support `#[primary_span] span: Option<Span>` in `Subdiagnostic`s

```
error: implementation of `TheTrait` is not general enough
  --> $DIR/associated-types-eq-hr.rs:96:5
   |
LL |     tuple_one::<Tuple>();
   |     ^^^^^^^^^^^^^^^^^^^^
   |
note: `Tuple` must implement `TheTrait<(&'0 isize, &'1 isize)>`, for any two lifetimes `'0` and `'1`...
  --> $DIR/associated-types-eq-hr.rs:59:8
   |
LL | fn tuple_one<T>()
LL | where
LL |     T: for<'x, 'y> TheTrait<(&'x isize, &'y isize), A = &'x isize>,
   |        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `tuple_one`
note: ...but it actually implements `TheTrait<(&'2 isize, &'2 isize)>`, for some specific lifetime `'2`
  --> $DIR/associated-types-eq-hr.rs:35:1
   |
LL | impl<'a> TheTrait<(&'a isize, &'a isize)> for Tuple {
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
```

The output now is closer to what the next trait solver will emit (E0277).
…the-same, r=clarfonthey

Don't imply incorrect things about `Global` in the docs of `System`

The global allocator has a lot more asterisks to it than we let on in the docs of `System`

r? libs
…tests, r=clarfonthey

fs::set_permissions_nofollow: Android support, test cleanup

Tracking issue: rust-lang#141607

try-job: *various*
try-job: *android*
…Urgau

[rustdoc] Correctly link to (imported) enum variants with "jump to def"

New bug I found while working on rust-lang#162808.

Explanations: this one was quite tricky as it took me a while to understand that variants could be imported and present in `Cache::external_paths`. So the path was entered while generating a link for "jump to def", generating a URL looking like this: `module/enum_name/variant.variant_name.html`, which is obviously very wrong as it should be `module/enum.enum_name.html#variant.variant_name`.

r? @Urgau
…tests, r=Urgau

Move more `rustdoc-html tests` in the right location

Follow-up of rust-lang#162372.

r? @Urgau
@rust-bors rust-bors Bot added the rollup A PR which is a rollup label Oct 3, 2026
@rustbot rustbot added A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-clippy Relevant to the Clippy team. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output. labels Oct 3, 2026
@JonathanBrouwer

Copy link
Copy Markdown
Member Author

@bors r+ p=5 force

Trying commonly failed jobs
@bors try jobs=dist-various-1,test-various,test-x86_64-gnu-aux,test-x86_64-msvc-1,test-aarch64-apple-1,test-aarch64-apple-2,test-x86_64-mingw-1,test-i686-msvc,test-armhf-gnu

@rust-bors

rust-bors Bot commented Oct 3, 2026

Copy link
Copy Markdown
Contributor

📌 Commit a8ecd3a has been approved by JonathanBrouwer

It is now in the queue for this repository.

@rust-bors rust-bors Bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 3, 2026
@rust-bors

This comment has been minimized.

rust-bors Bot pushed a commit that referenced this pull request Oct 3, 2026
Rollup of 6 pull requests


try-job: dist-various-1
try-job: test-various
try-job: test-x86_64-gnu-aux
try-job: test-x86_64-msvc-1
try-job: test-aarch64-apple-1
try-job: test-aarch64-apple-2
try-job: test-x86_64-mingw-1
try-job: test-i686-msvc
try-job: test-armhf-gnu
@jhpratt jhpratt closed this Oct 3, 2026
@rust-bors rust-bors Bot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Oct 3, 2026
@rust-bors

rust-bors Bot commented Oct 3, 2026

Copy link
Copy Markdown
Contributor

This pull request was unapproved due to being closed.

@rust-bors

rust-bors Bot commented Oct 3, 2026

Copy link
Copy Markdown
Contributor

☀️ Try build successful (CI)
Build commit: 0eeced3 (0eeced33bd076b7f2d9714f2cfdce2b7160667a6)
Base parent: db8f076 (db8f076d2619ce2585b0380dda06e8da25a40da4)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-translation Area: Translation infrastructure, and migrating existing diagnostics to SessionDiagnostic rollup A PR which is a rollup S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-clippy Relevant to the Clippy team. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants