-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Emit an error for invalid item of instruction_set #129002
base: master
Are you sure you want to change the base?
Conversation
r? @wesleywiser rustbot has assigned @wesleywiser. Use |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
256ac63
to
92fbd2c
Compare
☔ The latest upstream changes (presumably #129202) made this pull request unmergeable. Please resolve the merge conflicts. |
@chansuke if you can resolve the conflicts we can then push this pr forward. Thanks |
@@ -2349,6 +2353,43 @@ impl<'tcx> CheckAttrVisitor<'tcx> { | |||
} | |||
} | |||
} | |||
|
|||
fn check_instruction_set(&self, attr: &Attribute, _item: Option<ItemLike<'_>>) { |
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 think we also want to valid that item
is a function or closure and not anything else like a module or type (and use on any of those should give a specific error that the attribute can only be used on functions and such).
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.
@wesleywiser
Thank you for your review!! Ok, i'll fix that.
92fbd2c
to
35363d5
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
4ad825d
to
d696b47
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
564be4b
to
f3a6be9
Compare
This comment has been minimized.
This comment has been minimized.
The job Click to see the possible cause of the failure (guessed by this bot)
|
Closes #128489
Emit an error on invalid item of
instruction_set
.This PR merges the instruction_set error handling into rustc_passes/check_attr.rs. This change was necessary because the codegen_attrs only handle the
Fn
target.