-
Notifications
You must be signed in to change notification settings - Fork 13k
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
E05XX odyssey #43726
E05XX odyssey #43726
Conversation
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.
A few things to change but globally it's good.
src/librustc_passes/diagnostics.rs
Outdated
"##, | ||
|
||
E0571: r##" | ||
The `break` statement can take an argument (which will be the value of the loop |
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.
A long error explanation is supposed to start by a short summary of the error. The error explanation comes just after the erroneous code example and just before the fix.
src/libsyntax/diagnostic_list.rs
Outdated
E0552: r##" | ||
A unrecognized representation attribute was used. | ||
|
||
You can use a `repr` attribute to tell the compiler how you want a struct or |
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.
The explanation is supposed to be after the erroneous code example.
|
||
Example of erroneous code (on a stable compiler): | ||
|
||
```ignore (depends on release channel) |
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.
Just ignore
please.
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.
@GuillaumeGomez Just writing ignore
without explanation will cause tidy
failure. --explain
will strip them out though.
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.
Oh that's strange.
src/libsyntax/diagnostic_list.rs
Outdated
"##, | ||
|
||
E0557: r##" | ||
A feature attribute for a removed feature was used. |
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.
Seems a bit complicated when formulated this way.
@@ -1602,7 +1602,7 @@ fn maybe_stage_features(span_handler: &Handler, krate: &ast::Crate, | |||
if attr.check_name("feature") { | |||
let release_channel = option_env!("CFG_RELEASE_CHANNEL").unwrap_or("(unknown)"); | |||
span_err!(span_handler, attr.span, E0554, | |||
"#[feature] may not be used on the {} release channel", | |||
"#![feature] may not be used on the {} release channel", |
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.
Why this change?
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.
See the commit message.
It's more pleasing to use the inner-attribute syntax (`#!` rather than `#`) in the error message, as that is how `feature` attributes in particular will be declared (as they apply to the entire crate).
6e43cfd
to
116bf07
Compare
(updated) |
Thanks! @bors: r+ |
📌 Commit 116bf07 has been approved by |
…arty, r=GuillaumeGomez E05XX odyssey chipping away at the surface exposed by #43709 r? @GuillaumeGomez
☀️ Test successful - status-appveyor, status-travis |
chipping away at the surface exposed by #43709
r? @GuillaumeGomez