Rollup of 5 pull requests - #162572
Closed
Zalathar wants to merge 10 commits into
Closed
Conversation
…able When a diagnostic points into the standard library but its source isn't available locally (e.g. a rustup toolchain without the `rust-src` component), the emitter can only print the bare remapped path with no snippet. Emit a one-time `help` suggesting `rustup component add rust-src` so the next build can show the source. The hint is shown at most once per compilation (tracked with an `AtomicBool` on the emitter) and only for remapped std paths. It is added to both the primary and child-note fallbacks, since std spans usually appear in child "required by a bound in `core::...`" notes.
…t, r=estebank
Suggest installing `rust-src` when standard library source is unavailable
### Why
A lot of diagnostics point at a span *inside* the standard library e.g. `required by a bound in `std::iter::Iterator::sum``, or `JoinHandle::join takes ownership of the receiver`. For toolchains installed via `rustup` std is shipped with its paths remapped to `/rustc/<hash>/library/...` and the source itself is **not** included unless the `rust-src` component is installed.
So when an error references std, rustc tries to render that span, can't find the source on disk, and falls back to printing just the bare remapped path with no code:
```
error[E0277]: a value of type String cannot be made by summing an iterator ...
--> src/main.rs:2:20
...
note: required by a bound in std::iter::Iterator::sum
--> /rustc/<hash>/library/core/src/iter/traits/iterator.rs:3669:4
```
For the user this is a dead end: the path doesn't exist locally, there's no surrounding code. It *is* fixable: `rustup component add rust-src` makes the source available, after which the same diagnostic renders the real std snippet. But that capability is
invisible. This PR closes that discoverability gap by suggesting it at exactly the moment it would help.
Closes rust-lang#156402
…=bjorn3 Put manual calls of Enzyme intrinsics behind a feature gate r? bjorn3 fixes rust-lang#161820 I created the internal feature gate without a tracking issue. `autodiff` didn’t seem like it was the right one.
…skip, r=jieyouxu Revert "Skip rustc book on i686" Reverts rust-lang#158379 This should not be needed anymore since rust-lang#162288 merged
Add regression test for higher-ranked fn pointer trait impl mismatch errors Closes rust-lang#29061
…winwhite Add a revision for previously fixed solver issue Closes rust-lang/trait-system-refactor-initiative#87 , which has been previously fixed by rust-lang#149320 (cc https://rust-lang.zulipchat.com/#narrow/channel/618216-t-types.2Fcall-for-participation/topic/enable.20-Znext-solver.20for.20try-block.20test/with/622722733) r? adwinwhite
Member
Author
|
Rollup of everything. @bors r+ rollup=never p=5 |
Contributor
This comment has been minimized.
This comment has been minimized.
rust-bors Bot
pushed a commit
that referenced
this pull request
Sep 10, 2026
Rollup of 5 pull requests Successful merges: - #158191 (Suggest installing `rust-src` when standard library source is unavailable) - #162122 (Put manual calls of Enzyme intrinsics behind a feature gate) - #162553 (Revert "Skip rustc book on i686") - #162562 (Add regression test for higher-ranked fn pointer trait impl mismatch errors) - #162518 (Add a revision for previously fixed solver issue)
Collaborator
|
The job Click to see the possible cause of the failure (guessed by this bot) |
Contributor
|
💔 Test for 17d749c failed: CI. Failed job:
|
Collaborator
|
The job Click to see the possible cause of the failure (guessed by this bot) |
Member
Author
|
Failure was in #158191, which went on to immediately fail its own CI run anyway. |
Contributor
|
This pull request was unapproved due to being closed. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Successful merges:
rust-srcwhen standard library source is unavailable #158191 (Suggest installingrust-srcwhen standard library source is unavailable)r? @ghost
Create a similar rollup