Skip to content

Add info about IDs in the compiler #748

Closed
@mark-i-m

Description

@mark-i-m

We should add the following content about IDs:

ID memo:

  • LocalDefId - the best variant, if you can use it for something do it. Cannot address entities in other crates and fine-grained entities like individual expressions in the current crate. Can address any items.
  • DefId - the second choice. Can address entities in other crates, but cannot address fine-grained entities like individual expressions.
  • HirId - Can address fine-grained entities like individual expressions in the current crate. Fine-grained entities from other crates can never be addressed in rustc.
  • NodeId - The last choice. Can address fine-grained entities like individual expressions when HirIds are not yet created.

Originally posted by @petrochenkov in rust-lang/rust#73291 (comment)

Metadata

Metadata

Labels

E-easyDifficulty: might be a good place for a beginnerE-help-wantedCall for participation: extra help is wantedE-needs-writeupCall for participation: discussion can be written up without much research required

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions