]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_span/src/hygiene.rs
Rollup merge of #104552 - DebugSteven:warn-newer-x, r=jyn514
[rust.git] / compiler / rustc_span / src / hygiene.rs
index c2d8287f2431dc3faa5cad0a1b0070e97257dc72..4e70dfb614782e015325fb216133bba7d8eeda82 100644 (file)
@@ -104,6 +104,10 @@ fn assert_default_hashing_controls<CTX: HashStableContext>(ctx: &CTX, msg: &str)
         // `-Z incremental-ignore-spans` option. Normally, this option is disabled,
         // which will cause us to require that this method always be called with `Span` hashing
         // enabled.
+        //
+        // Span hashing can also be disabled without `-Z incremental-ignore-spans`.
+        // This is the case for instance when building a hash for name mangling.
+        // Such configuration must not be used for metadata.
         HashingControls { hash_spans }
             if hash_spans == !ctx.unstable_opts_incremental_ignore_spans() => {}
         other => panic!("Attempted hashing of {msg} with non-default HashingControls: {:?}", other),
@@ -316,6 +320,7 @@ pub fn expansion_cause(mut self) -> Option<Span> {
             // Stop going up the backtrace once include! is encountered
             if expn_data.is_root()
                 || expn_data.kind == ExpnKind::Macro(MacroKind::Bang, sym::include)
+                || expn_data.kind == ExpnKind::Inlined
             {
                 break;
             }