Skip to content

Commit 7b6ead2

Browse files
committed
Explain disabled span hashing.
1 parent 5b9360b commit 7b6ead2

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

compiler/rustc_span/src/hygiene.rs

+4
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,10 @@ fn assert_default_hashing_controls<CTX: HashStableContext>(ctx: &CTX, msg: &str)
104104
// `-Z incremental-ignore-spans` option. Normally, this option is disabled,
105105
// which will cause us to require that this method always be called with `Span` hashing
106106
// enabled.
107+
//
108+
// Span hashing can also be disabled without `-Z incremental-ignore-spans`.
109+
// This is the case for instance when building a hash for name mangling.
110+
// Such configuration must not be used for metadata.
107111
HashingControls { hash_spans }
108112
if hash_spans == !ctx.unstable_opts_incremental_ignore_spans() => {}
109113
other => panic!("Attempted hashing of {msg} with non-default HashingControls: {:?}", other),

0 commit comments

Comments
 (0)