Support underscore as associated const name - #158970
Conversation
This comment has been minimized.
This comment has been minimized.
|
This PR changes rustc_public cc @oli-obk, @celinval, @ouz-a HIR ty lowering was modified cc @fmease
cc @rust-lang/clippy These commits modify Please ensure that if you've changed the output:
cc @obi1kenobi |
|
r? @jackh726 rustbot has assigned @jackh726. Use Why was this reviewer chosen?The reviewer was selected based on:
|
This comment has been minimized.
This comment has been minimized.
- Adds `data: AssocConstData` to `AssocKind` to properly handle anonymous associated consts in ty. - Adds `named_items()` to `AssocItems` and changes some uses of `in_definition_order()` to use it instead.
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
This PR doesn't change the current behavior of the
dead_codelint for unused associated consts with underscore-prefixed names and treats associated consts named_consistently.There might still be some places that should've been changed to use
named_items()instead ofin_definition_order(), though I'm not quite sure.Unresolved questions:
impl Private { pub const _: Private = Private; }, where the visibility qualifier here has no effect. It seems like there wasn't any disagreement on linting this, though what's proposed in the RFC currently diverges from that: RFC: Associated const underscore.Tracking: