Skip to content

Commit

Permalink
update comment
Browse files Browse the repository at this point in the history
  • Loading branch information
lcnr authored and BoxyUwU committed Nov 28, 2024
1 parent 23ba2d1 commit d401a07
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion compiler/rustc_hir/src/def.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,16 @@ pub enum DefKind {
Use,
/// An `extern` block.
ForeignMod,
/// Anonymous constant, e.g. the `1 + 2` in `[u8; 1 + 2]`
/// Anonymous constant, e.g. the `1 + 2` in `[u8; 1 + 2]`.
///
/// Not all anon-consts are actually still relevant in the HIR. We lower
/// trivial const-arguments directly to `hir::ConstArgKind::Path`, at which
/// point the definition for the anon-const ends up unused and incomplete.
///
/// We do not provide any a `Span` for the definition and pretty much all other
/// queries also ICE when using this `DefId`. Given that the `DefId` of such
/// constants should only be reachable by iterating all definitions of a
/// given crate, you should not have to worry about this.
AnonConst,
/// An inline constant, e.g. `const { 1 + 2 }`
InlineConst,
Expand Down

0 comments on commit d401a07

Please sign in to comment.