Skip to content

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

Merged
merged 4 commits into from Dec 16, 2020
Merged

New internal lint: Interning defined symbol #6448

merged 4 commits into from Dec 16, 2020

Conversation

ghost
Copy link

@ghost ghost commented Dec 13, 2020

New internal lint: interning_defined_symbol

changelog: none

@rust-highfive
Copy link

r? @Manishearth

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Dec 13, 2020
@ghost ghost changed the title Interning defined symbol New internal lint: Interning defined symbol Dec 13, 2020
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) };
Copy link
Author

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.

@ghost
Copy link
Author

ghost commented Dec 14, 2020

I thought of a way of doing this without unsafe code. I'll update later.

@rustbot modify labels: +S-waiting-on-author

@rustbot rustbot added the S-waiting-on-author Status: This is awaiting some action from the author. (Use `@rustbot ready` to update this status) label Dec 14, 2020
@ghost
Copy link
Author

ghost commented Dec 16, 2020

@rustbot modify labels: -S-waiting-on-author

@rustbot rustbot removed the S-waiting-on-author Status: This is awaiting some action from the author. (Use `@rustbot ready` to update this status) label Dec 16, 2020
@Manishearth
Copy link
Member

@bors r+

great idea!

@bors
Copy link
Contributor

bors commented Dec 16, 2020

📌 Commit f732cc5 has been approved by Manishearth

@bors
Copy link
Contributor

bors commented Dec 16, 2020

⌛ Testing commit f732cc5 with merge 142f0f5...

@bors
Copy link
Contributor

bors commented Dec 16, 2020

☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test
Approved by: Manishearth
Pushing 142f0f5 to master...

@bors bors merged commit 142f0f5 into rust-lang:master Dec 16, 2020
@ghost ghost deleted the interning_defined_symbol branch December 24, 2020 04:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants