Add target checking to #[register_tool]#157377
Conversation
|
Some changes occurred in compiler/rustc_attr_parsing |
This comment has been minimized.
This comment has been minimized.
10dede4 to
2a28ba8
Compare
This comment has been minimized.
This comment has been minimized.
| #[register_tool(xyz)] | ||
| //~^ WARN crate-level attribute should be an inner attribute | ||
| unreachable!(); | ||
| } |
There was a problem hiding this comment.
Can this be an error? I notice crate level attrs are basically allowed anywhere, I'd like that not to be the case with a new crate level attribute if I can help it.
This comment has been minimized.
This comment has been minimized.
|
The reason that this is a warning is because it historically was. When we initially wrote the attribute parsers the first goal was preserving behavior. I think it makes sense to change this tho, and I think the time has come that for all unstable attributes we should change this. I'll open a PR tomorrow |
|
📋 This PR cannot be approved because it has merge conflicts. Please resolve the conflicts and try again. |
2a28ba8 to
957e505
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. |
|
@bors r=mejrs |
…=mejrs Make distinction between crate-level attributes that are warned vs errored r? @mejrs This is a follow-up to rust-lang#157377 (comment) This PR makes all unstable crate-level attributes error on incorrect targets. To make the diff more helpful, I'd recommend reviewing the two commits separately. * The first commit introduces the infra & makes all crate-level attributes a warning, the commit should have no effect * The second commit undoes some changes from the first commit, to make all unstable crate-level attributes error
…=mejrs Make distinction between crate-level attributes that are warned vs errored r? @mejrs This is a follow-up to rust-lang#157377 (comment) This PR makes all unstable crate-level attributes error on incorrect targets. To make the diff more helpful, I'd recommend reviewing the two commits separately. * The first commit introduces the infra & makes all crate-level attributes a warning, the commit should have no effect * The second commit undoes some changes from the first commit, to make all unstable crate-level attributes error
…=mejrs Make distinction between crate-level attributes that are warned vs errored r? @mejrs This is a follow-up to rust-lang#157377 (comment) This PR makes all unstable crate-level attributes error on incorrect targets. To make the diff more helpful, I'd recommend reviewing the two commits separately. * The first commit introduces the infra & makes all crate-level attributes a warning, the commit should have no effect * The second commit undoes some changes from the first commit, to make all unstable crate-level attributes error
…=mejrs Make distinction between crate-level attributes that are warned vs errored r? @mejrs This is a follow-up to rust-lang#157377 (comment) This PR makes all unstable crate-level attributes error on incorrect targets. To make the diff more helpful, I'd recommend reviewing the two commits separately. * The first commit introduces the infra & makes all crate-level attributes a warning, the commit should have no effect * The second commit undoes some changes from the first commit, to make all unstable crate-level attributes error
Rollup merge of #157443 - JonathanBrouwer:crate-level-err, r=mejrs Make distinction between crate-level attributes that are warned vs errored r? @mejrs This is a follow-up to #157377 (comment) This PR makes all unstable crate-level attributes error on incorrect targets. To make the diff more helpful, I'd recommend reviewing the two commits separately. * The first commit introduces the infra & makes all crate-level attributes a warning, the commit should have no effect * The second commit undoes some changes from the first commit, to make all unstable crate-level attributes error
r? @mejrs