-
-
Notifications
You must be signed in to change notification settings - Fork 14.5k
Move error emitted by attrs #[rustc_symbol_name] and #[rustc_def_path] from codegen pass to check_attr.rs
#152368
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: main
Are you sure you want to change the base?
Conversation
|
Some changes occurred in compiler/rustc_passes/src/check_attr.rs |
|
r? @davidtwco rustbot has assigned @davidtwco. Use Why was this reviewer chosen?The reviewer was selected based on:
|
|
might be good to do a perf run? |
instead just check and emit this attribute error through `check_attr.rs`
cdc764e to
d1cb52c
Compare
|
r? me |
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.
Given that I'd prefer to keep the code where it currently is, since this happening during codegen seems like the more logical place to me, sorry
| // if the `rustc_attrs` feature is not enabled, then the | ||
| // attributes we are interested in cannot be present anyway, so | ||
| // skip the walk. | ||
| if !tcx.features().rustc_attrs() { |
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.
Because of this check there shouldn't be any perf difference, this will be false for any realistic crate
|
Reminder, once the PR becomes ready for a review, use |
|
☔ The latest upstream changes (presumably #152373) made this pull request unmergeable. Please resolve the merge conflicts. |
Currently, to emit the errors, during codegen we iterate over all feasible targets that these attributes could be placed on, this PR changes it so that we just emit these errors in the
check_attrstep of attribute parsing, since this check is guaranteed to already iterate through all attributes, it should (I think), be a little bit faster to emit from there instead