Only enable relative span hashing on nightly.

This commit is contained in:
Camille GILLOT
2022-12-09 16:36:28 +00:00
parent 65f342daea
commit 40c8165395
5 changed files with 12 additions and 3 deletions

View File

@@ -776,7 +776,7 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
/// Intercept all spans entering HIR.
/// Mark a span as relative to the current owning item.
fn lower_span(&self, span: Span) -> Span {
if self.tcx.sess.opts.incremental.is_some() {
if self.tcx.sess.opts.incremental_relative_spans() {
span.with_parent(Some(self.current_hir_id_owner.def_id))
} else {
// Do not make spans relative when not using incremental compilation.