@@ -89,11 +89,11 @@ rustc_index::newtype_index! {
89
89
}
90
90
}
91
91
92
- // Assert that the provided `HashStableContext` is configured with the 'default'
93
- // `HashingControls`. We should always have bailed out before getting to here
94
- // with a non-default mode. With this check in place, we can avoid the need
95
- // to maintain separate versions of `ExpnData` hashes for each permutation
96
- // of `HashingControls` settings.
92
+ /// Assert that the provided `HashStableContext` is configured with the 'default'
93
+ /// `HashingControls`. We should always have bailed out before getting to here
94
+ /// with a non-default mode. With this check in place, we can avoid the need
95
+ /// to maintain separate versions of `ExpnData` hashes for each permutation
96
+ /// of `HashingControls` settings.
97
97
fn assert_default_hashing_controls < CTX : HashStableContext > ( ctx : & CTX , msg : & str ) {
98
98
match ctx. hashing_controls ( ) {
99
99
// Ideally, we would also check that `node_id_hashing_mode` was always
@@ -105,7 +105,13 @@ fn assert_default_hashing_controls<CTX: HashStableContext>(ctx: &CTX, msg: &str)
105
105
// FIXME: Enforce that we don't end up transitively hashing any `HirId`s,
106
106
// or ensure that this method is always invoked with the same
107
107
// `NodeIdHashingMode`
108
- HashingControls { hash_spans : true , node_id_hashing_mode : _ } => { }
108
+ //
109
+ // Note that we require that `hash_spans` be set according to the global
110
+ // `-Z incremental-ignore-spans` option. Normally, this option is disabled,
111
+ // which will cause us to require that this method always be called with `Span` hashing
112
+ // enabled.
113
+ HashingControls { hash_spans, node_id_hashing_mode : _ }
114
+ if hash_spans == !ctx. debug_opts_incremental_ignore_spans ( ) => { }
109
115
other => panic ! ( "Attempted hashing of {msg} with non-default HashingControls: {:?}" , other) ,
110
116
}
111
117
}
0 commit comments