Repository navigation
Improve diagnostics for suggestions of unstable items - #161943
KevinA-cpu wants to merge 7 commits into
Conversation
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
@bors try jobs=x86_64-gnu-stable |
This comment has been minimized.
This comment has been minimized.
…rinsics-suggestions, r=<try> Improve rustc diagnostics try-job: x86_64-gnu-stable
| LL | let _: BorrowedBuf; | ||
| | ^^^^^^^^^^^ not found in this scope | ||
| | | ||
| = note: 'std::io::BorrowedBuf' is unstable in nightly Rust and is only available with the `#![feature(core_io_borrowed_buf)]` attribute |
There was a problem hiding this comment.
Could you place the note below the help: consider importing this struct? That improves the reading order
There was a problem hiding this comment.
I want to clarify @JonathanBrouwer, do you want to reorder so that the note is below the help universally, or do you only want this particular new note we're adding to be below the help?
Below is an example where a note above the help might be more useful:
= note: 'std::convert::TryFrom' is included in the prelude starting in Edition 2021
help: consider importing this traitThere was a problem hiding this comment.
I mean I want the note to be under the help universally.
The idea being that we first tell the user "you might have meant x" then "by the way, x is unstable". If you start with "x is unstable" its not obvious why the compiler is telling us that until you read the next sentence
There was a problem hiding this comment.
The note is still above the help.
That is, I want
error[E0425]: cannot find type `BorrowedBuf` in this scope
--> $DIR/import-suggestion-unstable-feature-note.rs:9:12
|
LL | let _: BorrowedBuf;
| ^^^^^^^^^^^ not found in this scope
|
= note: 'std::io::BorrowedBuf' is unstable, add `#![feature(core_io_borrowed_buf)]` to the crate attributes to enable
help: consider importing this struct
|
LL + use std::io::BorrowedBuf;
|
To change to (approximately)
error[E0425]: cannot find type `BorrowedBuf` in this scope
--> $DIR/import-suggestion-unstable-feature-note.rs:9:12
|
LL | let _: BorrowedBuf;
| ^^^^^^^^^^^ not found in this scope
|
help: consider importing this struct
|
LL + use std::io::BorrowedBuf;
|
note: 'std::io::BorrowedBuf' is unstable, add `#![feature(core_io_borrowed_buf)]` to the crate attributes to enable
There was a problem hiding this comment.
Sorry for the late review! Due to a mix of conferences and illness I didn't get around to it earlier
@rustbot author
There was a problem hiding this comment.
@JonathanBrouwer no worries, I actually have to thank you for taking the time to review and help me grow. Like there's no financial incentive for you right?
I myself wants to be like you and many others in the rust contributors team - getting a chance to attends conferences and all that 😆
I'm actually also going through some career transition as well, it's exhausting, I'll get on to address your comments as soon as thing stabilizes!
There was a problem hiding this comment.
Like there's no financial incentive for you right
Since a few weeks maintaining the rust compiler is now my full-time job, through the RustNL maintainers team. Before that I was indeed fully unpaid, so many thanks to them :)
There was a problem hiding this comment.
I'm actually also going through some career transition as well, it's exhausting, I'll get on to address your comments as soon as thing stabilizes!
No worries, take as long as you need, you're volunteering your time here after all. And good luck with the career transition <3
|
Reminder, once the PR becomes ready for a review, use |
|
@rustbot ready |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
- Add a note for unstable suggestions - Only suggest intrinsics when `core_intrinsics` feature is enabled
a7202d8 to
df6364a
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
|
This comment has been minimized.
This comment has been minimized.
|
Fyi I'm on holidays (at Eurorust) this week I'll get to any review next week |
|
@rustbot ready |
|
☔ The latest upstream changes (presumably #164804) made this pull request unmergeable. Please resolve the merge conflicts by rebasing. |
View all comments
core_intrinsicsfeature is enabledr? @JonathanBrouwer
Related:
Started from issue #78130
Created PR #161540 for regression tests
Then move to this PR for improvement points