-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Don't lint against named labels in naked_asm!
#140871
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
r? @davidtwco rustbot has assigned @davidtwco. Use |
This comment has been minimized.
This comment has been minimized.
Naked functions are allowed to define global labels, just like `global_asm!`.
// Trigger on naked fns too, even though they can't be inlined, reusing a | ||
// label or LTO can cause labels to break |
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.
Why is this not a valid concern?
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 don't think the original reasoning for closing #88169 was correct (even though it did come from me). Fundamentally there's no reason why you can't define global symbols in naked functions, the issue is only with local symbols (.Lfoo
) which are local to the object file (rustc doesn't guarantee that each asm block is in a separate object file).
In any case #128004 changed naked functions to use global_asm!
internally so there's no reason to treat it different (this lint is already disabled for global_asm!
).
Naked functions are allowed to define global labels, just like
global_asm!
.