-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Lang item cleanups #103603
Lang item cleanups #103603
Conversation
r? @oli-obk (rustbot has picked a reviewer for you, use r? to override) |
Some changes occurred in src/tools/clippy cc @rust-lang/clippy |
35b2b81
to
79d5cc4
Compare
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.
r=me with comments resolved
79d5cc4
to
e4eb7ae
Compare
e4eb7ae
to
1c8e658
Compare
cc @davidtwco, @compiler-errors, @JohnTitor, @estebank, @TaKO8Ki |
@bors r=oli-obk |
I just removed a diagnostic struct in favor of |
Rollup of 5 pull requests Successful merges: - rust-lang#103338 (Fix unreachable_pub suggestion for enum with fields) - rust-lang#103603 (Lang item cleanups) - rust-lang#103732 (Revert "Make the `c` feature for `compiler-builtins` opt-in instead of inferred") - rust-lang#103766 (Add tracking issue to `error_in_core`) - rust-lang#103789 (Update E0382.md) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Add variant_name function to `LangItem` Clippy has an internal lint that checks for the usage of hardcoded def paths and suggests to replace them with a lang or diagnostic item, if possible. This was implemented with a hack, by getting all the variants of the `LangItem` enum and then index into it with the position of the `LangItem` in the `items` list. This is no longer possible, because the `items` list can't be accessed anymore. Follow up to rust-lang#103603 cc `@camsteffen` r? `@oli-obk` This is blocking the sync between Clippy and Rust. I'm not sure if this is the best solution here, or if I should add a method `items()` to `LanguageItems` and keep the code in Clippy unchanged.
Add variant_name function to `LangItem` Clippy has an internal lint that checks for the usage of hardcoded def paths and suggests to replace them with a lang or diagnostic item, if possible. This was implemented with a hack, by getting all the variants of the `LangItem` enum and then index into it with the position of the `LangItem` in the `items` list. This is no longer possible, because the `items` list can't be accessed anymore. Follow up to rust-lang#103603 cc `@camsteffen` r? `@oli-obk` This is blocking the sync between Clippy and Rust. I'm not sure if this is the best solution here, or if I should add a method `items()` to `LanguageItems` and keep the code in Clippy unchanged.
Various cleanups related to lang items.