Remove the sym::Deref diagnostic item by samueltardieu · Pull Request #148033 · rust-lang/rust (original) (raw)
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looking at the changes, while I think avoiding duplication between diagnostic and lang items is good, the changes themselves are... not amazing.
I feel like ideally code shouldn't have to care about the difference between lang and diagnostics items. What are the meaningful differences between em
- lang item use an enum preventing accidentally referring to an item that doesn't actually exist, while diagnostic items theoretically allow being introduced in third party crates without rustc knowing about it (just for clippy)
- being a diagnostic item should not impact happy path behavior in any way. it should only matter for diagnostics, while lang items are more interesting as they also impact semantics
I guess this is fine and don't have a great suggestion here. I think some API which fetches either the diagnostic or the lang item name would be nice so that the set of diagnostic items is always a super set of all lang items. But 🤷 on how to do that and think it doesn't have to happen rn. Would be happy if you (or somebody else) wants to look into that separately from this PR