-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Port #[should_panic]
to the new attribute parsing infrastructure
#143808
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
base: master
Are you sure you want to change the base?
Port #[should_panic]
to the new attribute parsing infrastructure
#143808
Conversation
|
These commits modify the If this was unintentional then you should revert the changes before this PR is merged. Some changes occurred in compiler/rustc_attr_data_structures Some changes occurred in compiler/rustc_attr_parsing Some changes occurred in compiler/rustc_passes/src/check_attr.rs |
match BUILTIN_ATTRIBUTE_MAP.get(name) { | ||
// checked below | ||
Some(BuiltinAttribute { type_: AttributeType::CrateLevel, .. }) => {} | ||
Some(_) => { | ||
if rest.len() > 0 && AttributeParser::<Late>::is_parsed_attribute(slice::from_ref(name)) { |
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.
@@ -1,4 +1,3 @@ | |||
//@ check-pass |
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.
This is a breaking change! Malformed should_panic
attributes have had the following warning since 2016:
warning: argument must be of the form: `expected = "error message"`
--> src/main.rs:5:1
|
5 | #[should_panic(expected = "foo", bar)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: errors in this attribute were erroneously allowed and will become a hard error in a future release
This PR makes this an error.
As discussed in #142838 (comment), we can make breaking changes as long as we do a crater run. So this PR needs a crater run.
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.
This issue is currently NOT solved by this PR.
We can do this in a future PR or now, but we should decide whether this should be a warning or error:
#143799
☔ The latest upstream changes (presumably #143810) made this pull request unmergeable. Please resolve the merge conflicts. |
…trVisitor Signed-off-by: Jonathan Brouwer <[email protected]>
Signed-off-by: Jonathan Brouwer <[email protected]>
Signed-off-by: Jonathan Brouwer <[email protected]>
9014cc9
to
dd9d982
Compare
Ports
#[should_panic]
to the new attribute parsing infrastructure for #131229 (comment)r? @jdonszelmann