-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Port #[no_mangle]
to new attribute parsing infrastructure
#142823
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
|
Some changes occurred in src/tools/clippy cc @rust-lang/clippy Some changes occurred in compiler/rustc_codegen_ssa Some changes occurred in compiler/rustc_passes/src/check_attr.rs Some changes occurred in compiler/rustc_attr_data_structures Some changes occurred in compiler/rustc_codegen_ssa/src/codegen_attrs.rs Some changes occurred in compiler/rustc_attr_parsing rust-analyzer is developed in its own repository. If possible, consider making this change to rust-lang/rust-analyzer instead. cc @rust-lang/rust-analyzer |
| | ||
LL | #[no_mangle] | ||
| ^^^^^^^^^^^^ | ||
= warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! |
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 warning is new, but I think this is reasonable in this context.
Is adding this warning acceptable?
This comment has been minimized.
This comment has been minimized.
1735b54
to
db15940
Compare
This comment has been minimized.
This comment has been minimized.
db15940
to
df4ad9e
Compare
Woops I accidentally rebased on the wrong commit and git did not like that, should be good now :P |
This comment has been minimized.
This comment has been minimized.
r=me after that and ci |
@rustbot author |
Reminder, once the PR becomes ready for a review, use |
ed3740a
to
ae3ece2
Compare
rustdoc-json-types is a public (although nightly-only) API. If possible, consider changing cc @CraftSpider, @aDotInTheVoid, @Enselic, @obi1kenobi These commits modify Please ensure that if you've changed the output:
|
71e01ef
to
06e2148
Compare
This comment has been minimized.
This comment has been minimized.
06e2148
to
88cb1ae
Compare
This comment has been minimized.
This comment has been minimized.
88cb1ae
to
ad3b620
Compare
This comment has been minimized.
This comment has been minimized.
88fc125
to
5afce2b
Compare
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
5afce2b
to
628e1ee
Compare
@rustbot ready |
@@ -1,6 +1,6 @@ | |||
//@ edition: 2021 | |||
#![no_std] | |||
|
|||
//@ is "$.index[?(@.name=='example')].attrs" '["#[no_mangle]"]' | |||
//@ is "$.index[?(@.name=='example')].attrs" '["#[attr = NoMangle]"]' |
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 believe the code changes reverted the pretty-print output here, so this test change might not be necessary anymore and might need to be reverted.
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 believe the code changes only apply to rustdoc, there's a separate if statement earlier in that function for rustdoc-json.
Not sure if the seperate formatting between the two is ideal tho, would be nice to keep that consistent
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.
For rustdoc JSON it would be strongly preferable to have #[no_mangle]
because the alternative will break cargo-semver-checks
. The consistency argument is also very good.
So I'm in favor of making the change here if at all possible, and in a separate PR otherwise.
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'll make the change in this PR, will do it tomorrow
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.
Thank you, I really appreciate it — it will make my cargo-semver-checks
work a lot easier!
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.
Thanks for your work btw, love the tool!
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.
Thank you, that made my day!
@@ -4,6 +4,6 @@ | |||
// The representation of `#[unsafe(no_mangle)]` in rustdoc in edition 2024 | |||
// is still `#[no_mangle]` without the `unsafe` attribute wrapper. | |||
|
|||
//@ is "$.index[?(@.name=='example')].attrs" '["#[no_mangle]"]' | |||
//@ is "$.index[?(@.name=='example')].attrs" '["#[attr = NoMangle]"]' |
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.
Same with this change.
@rustbot author |
☔ The latest upstream changes (presumably #142826) made this pull request unmergeable. Please resolve the merge conflicts. |
Ports
no_mangle
to the new attribute parsing infrastructure for #131229 (comment)r? @jdonszelmann