Skip to content

Commit 20060c6

Browse files
committed
Add a useful comment to NodeId::hash_stable.
1 parent fa575bc commit 20060c6

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

compiler/rustc_ast/src/node_id.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ rustc_index::newtype_index! {
2222
impl HashStable for NodeId {
2323
#[inline]
2424
fn hash_stable<Hcx: HashStableContext>(&self, _: &mut Hcx, _: &mut StableHasher) {
25+
// This impl is never called but is necessary for types implementing `HashStable` such as
26+
// `MainDefinition` and `DocLinkResMap` (both of which occur in `ResolverGlobalCtxt`).
2527
panic!("Node IDs should not appear in incremental state");
2628
}
2729
}

0 commit comments

Comments
 (0)