Rename some body_id to body_def_id#158696
Conversation
|
Some changes occurred to the core trait solver cc @rust-lang/initiative-trait-system-refactor Some changes occurred to the CTFE machinery changes to the core type system cc @lcnr Some changes occurred to constck cc @fee1-dead Some changes occurred to MIR optimizations cc @rust-lang/wg-mir-opt Some changes occurred in need_type_info.rs cc @lcnr Some changes occurred in engine.rs, potentially modifying the public API of cc @lcnr |
|
r? @oli-obk rustbot has assigned @oli-obk. Use Why was this reviewer chosen?The reviewer was selected based on:
|
|
hmm... various of those are not items. The DefId of a const block has a body, but is not an item. I don't know if this really is an improvement even in the few cases where it may be unambiguous. Is there some other discussions that led you to doing this PR? |
Okay, that's my mistake, I thought they were. How about |
|
I noticed that |
`body_id` is often used to mean "ID of a body-owning node", which is confusing since the obvious reading as "body ID" is wrong. `body_def_id` is easier to read as "body-owning definition ID".
body_id to item_id where applicablebody_id to body_def_id
|
☔ The latest upstream changes (presumably #158795) made this pull request unmergeable. Please resolve the merge conflicts by rebasing. |
Since body IDs and item IDs are distinct things, try to use names that do not conflate them.
body_def_idis a little easier to read as "body-owning definition ID" whereasbody_idis hard not to just read as "body ID".Related: #158611 - I noticed this afterwards. I suspect that
FnCtxtought to keepbody_def_idbut maybe addbody_id: BodyIdin addition.