-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Port #[link]
to the new attribute parsing infrastructure
#143193
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?
Conversation
47c45bb
to
aaf7d53
Compare
This comment has been minimized.
This comment has been minimized.
☔ The latest upstream changes (presumably #143233) made this pull request unmergeable. Please resolve the merge conflicts. |
aaf7d53
to
d43b4b5
Compare
This comment has been minimized.
This comment has been minimized.
147aeec
to
29b3648
Compare
29b3648
to
6b10a20
Compare
PrintAttribute | ||
)] | ||
#[derive(HashStable_Generic)] | ||
pub enum NativeLibKind { |
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 type was moved here because it is needed for the link attribute and the original location caused a dependency cycle
|
||
#[link(name = "bar", import_name_type = "decorated", kind = "raw-dylib")] | ||
#[link(name = "bar", kind = "raw-dylib")] |
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 test is not testing for the invalid attribute, but instead for the link attribute on an extern type. Because attributes are parsed earlier and this attribute was invalid the error blocked the crash from happening. This is true for quite a few other of the test changes as well
@@ -81,8 +81,7 @@ | |||
#[export_stable = 1] | |||
//~^ ERROR malformed | |||
#[link] | |||
//~^ ERROR attribute must be of the form | |||
//~| WARN this was previously accepted by the compiler | |||
//~^ ERROR malformed |
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.
BREAKING CHANGE 1: A #[link]
attribute which is not a list #[link(...)]
used to be a warning future error, is now an error. This needs a crater run.
@@ -61,7 +61,7 @@ | |||
#![doc = "2400"] | |||
#![cold] //~ WARN attribute should be applied to a function | |||
//~^ WARN this was previously accepted | |||
#![link()] //~ WARN attribute should be applied to an `extern` block | |||
#![link(name = "x")] //~ WARN attribute should be applied to an `extern` block |
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.
BREAKING CHANGE 2: A link attribute applied to an invalid target was not checked for syntactic correctness, it now is. The invalid target remains a warning, but the syntactic corectness is now checked
@rustbot ready Needs a crater run |
|
Some changes occurred in compiler/rustc_passes/src/check_attr.rs Some changes occurred in compiler/rustc_attr_parsing Some changes occurred in compiler/rustc_codegen_ssa 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 This PR changes a file inside |
@bors try @craterbot queue |
Port `#[link]` to the new attribute parsing infrastructure Ports `link` to the new attribute parsing infrastructure for #131229 (comment) This rework is not yet finished, it is blocked on the `cfg` attribute being finished, since `link` takes a `cfg` attribute as argument `@rustbot` blocked
☀️ Try build successful - checks-actions |
@craterbot queue |
🚨 Error: failed to parse the command 🆘 If you have any trouble with Crater please ask in t-infra on Zulip |
@craterbot check oops |
🚨 Error: failed to parse the command 🆘 If you have any trouble with Crater please ask in t-infra on Zulip |
@craterbot check |
👌 Experiment ℹ️ Crater is a tool to run experiments across parts of the Rust ecosystem. Learn more |
Ports
link
to the new attribute parsing infrastructure for #131229 (comment)This rework is not yet finished, it is blocked on the
cfg
attribute being finished, sincelink
takes acfg
attribute as argument@rustbot blocked