Enable relative span hashing.

This commit is contained in:
Camille GILLOT
2021-06-10 20:34:42 +02:00
parent 66e0316414
commit 65f342daea
4 changed files with 3 additions and 5 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.unstable_opts.incremental_relative_spans {
if self.tcx.sess.opts.incremental.is_some() {
span.with_parent(Some(self.current_hir_id_owner.def_id))
} else {
// Do not make spans relative when not using incremental compilation.