@@ -89,11 +89,11 @@ rustc_index::newtype_index! {
8989 }
9090}
9191
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.
9797fn assert_default_hashing_controls < CTX : HashStableContext > ( ctx : & CTX , msg : & str ) {
9898 match ctx. hashing_controls ( ) {
9999 // 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)
105105 // FIXME: Enforce that we don't end up transitively hashing any `HirId`s,
106106 // or ensure that this method is always invoked with the same
107107 // `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 ( ) => { }
109115 other => panic ! ( "Attempted hashing of {msg} with non-default HashingControls: {:?}" , other) ,
110116 }
111117}
0 commit comments