-
Notifications
You must be signed in to change notification settings - Fork 13.5k
minicore: use core's diagnostic::on_unimplemented
messages
#143329
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
minicore: use core's diagnostic::on_unimplemented
messages
#143329
Conversation
|
This PR modifies cc @jieyouxu |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that #137531 is only intended for the type signature (and lang items and whatnot), wasn't really intended for diagnostics attributes.
As for this, I'm not super sure. Why does the diagnostics difference only affect the riscv target?
#[diagnostic::on_unimplemented( | ||
message = "values of type `{Self}` may or may not have a size", | ||
label = "may or may not have a known size" | ||
)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Discussion [DIAG 1/2]: hm, this is kinda annoying because then you'd have to keep the diagnostic attribute content in sync, but I'm not sure of a better solution so this seems reasonable.
#[diagnostic::on_unimplemented( | ||
message = "values of type `{Self}` may or may not have a size", | ||
label = "may or may not have a known size" | ||
)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggestion [DIAG 2/2]: if we decide to go with this, can you make sure to leave a comment mentioning needing to sync the diagnostics attribute in the real core
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a note at the top of minicore.rs
, or did you mean to add the note in library/core
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To make this easier to discover, can you also add this note additionally to:
- The real
library/core
and say something like "please keep the#[diagnostic::on_unimplemented]
attributes in sync withtests/auxiliary/minicore.rs
- And also add a quick section about the sync requirement to rustc-dev-guide's
minicore
page https://rustc-dev-guide.rust-lang.org/tests/minicore.html
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
library/core/lib.rs
didn't really have a place where that comment felt right (and would be seen), so I added a note to library/core/src/marker.rs
, where the diagnostics we now replicate actually live.
I know, it's just that the diagnostics are, as you note, now something to also keep up-to-date.
It doesn't, the difference is between with and without the real |
bc5bca7
to
62b64f5
Compare
Thanks, the changes look good, just #143329 (comment) to help other contributors discover this is a thing. @rustbot author |
Reminder, once the PR becomes ready for a review, use |
62b64f5
to
8512e39
Compare
The rustc-dev-guide subtree was changed. If this PR only touches the dev guide consider submitting a PR directly to rust-lang/rustc-dev-guide otherwise thank you for updating the dev guide with your changes. |
the notes were added @rustbot ready |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, r=me once PR CI is green.
@bors delegate+ rollup |
✌️ @folkertdev, you can now approve this pull request! If @jieyouxu told you to " |
…unimplemented, r=jieyouxu minicore: use core's `diagnostic::on_unimplemented` messages Without these attributes, the error message is different. Keeping the diagnostics up-to-date seems related to rust-lang#137531. The modified test files are reported in rust-lang#143319 as failing for `--target=riscv64gc-unknown-linux-gnu`. Using `minicore` for them makes it easier to troubleshoot this sort of issue. r? `@jieyouxu`
Rollup of 6 pull requests Successful merges: - #134006 (setup typos check in CI) - #142876 (Port `#[target_feature]` to new attribute parsing infrastructure) - #143038 (avoid suggesting traits from private dependencies) - #143083 (Fix rustdoc not correctly showing attributes on re-exports) - #143283 (document optional jobs) - #143329 (minicore: use core's `diagnostic::on_unimplemented` messages) Failed merges: - #143237 (Port `#[no_implicit_prelude]` to the new attribute parsing infrastructure) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of #143329 - folkertdev:minicore-diagnostic-on-unimplemented, r=jieyouxu minicore: use core's `diagnostic::on_unimplemented` messages Without these attributes, the error message is different. Keeping the diagnostics up-to-date seems related to #137531. The modified test files are reported in #143319 as failing for `--target=riscv64gc-unknown-linux-gnu`. Using `minicore` for them makes it easier to troubleshoot this sort of issue. r? ``@jieyouxu``
Without these attributes, the error message is different. Keeping the diagnostics up-to-date seems related to #137531.
The modified test files are reported in #143319 as failing for
--target=riscv64gc-unknown-linux-gnu
. Usingminicore
for them makes it easier to troubleshoot this sort of issue.r? @jieyouxu