Skip to content

Commit 9b82411

Browse files
committed
Only mark spans in incremental mode.
1 parent 585fe45 commit 9b82411

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Diff for: compiler/rustc_resolve/src/def_collector.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,9 @@ impl<'a, 'b, 'tcx> DefCollector<'a, 'b, 'tcx> {
131131

132132
impl<'a, 'b, 'tcx> mut_visit::MutVisitor for DefCollector<'a, 'b, 'tcx> {
133133
fn visit_span(&mut self, span: &mut Span) {
134-
*span = span.with_parent(Some(self.parent_def));
134+
if self.resolver.tcx.sess.opts.incremental.is_some() {
135+
*span = span.with_parent(Some(self.parent_def));
136+
}
135137
}
136138

137139
#[tracing::instrument(level = "trace", skip(self))]

0 commit comments

Comments
 (0)