-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New internal lint: Interning defined symbol #6448
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
Conversation
r? @Manishearth (rust-highfive has picked a reviewer for you, use r? to override) |
then { | ||
// SAFETY: We're converting the raw bytes of the symbol value back | ||
// into a Symbol instance. | ||
let symbol = unsafe { std::mem::transmute::<u32, Symbol>(value) }; |
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'm doubting if this is actually safe. This might be wrong if the compiler uses a different version of rustc_span
and symbols were added or removed.
I thought of a way of doing this without unsafe code. I'll update later. @rustbot modify labels: +S-waiting-on-author |
@rustbot modify labels: -S-waiting-on-author |
@bors r+ great idea! |
📌 Commit f732cc5 has been approved by |
☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
New internal lint: interning_defined_symbol
changelog: none