Skip to content

Commit afaf8b5

Browse files
committed
update comment
1 parent 59a5fa3 commit afaf8b5

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

compiler/rustc_hir/src/def.rs

+10-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,16 @@ pub enum DefKind {
109109
Use,
110110
/// An `extern` block.
111111
ForeignMod,
112-
/// Anonymous constant, e.g. the `1 + 2` in `[u8; 1 + 2]`
112+
/// Anonymous constant, e.g. the `1 + 2` in `[u8; 1 + 2]`.
113+
///
114+
/// Not all anon-consts are actually still relevant in the HIR. We lower
115+
/// trivial const-arguments directly to `hir::ConstArgKind::Path`, at which
116+
/// point the definition for the anon-const ends up unused and incomplete.
117+
///
118+
/// We do not provide any a `Span` for the definition and pretty much all other
119+
/// queries also ICE when using this `DefId`. Given that the `DefId` of such
120+
/// constants should only be reachable by iterating all definitions of a
121+
/// given crate, you should not have to worry about this.
113122
AnonConst,
114123
/// An inline constant, e.g. `const { 1 + 2 }`
115124
InlineConst,

0 commit comments

Comments
 (0)