Skip to content

Commit

Permalink
Only mark spans in incremental mode.
Browse files Browse the repository at this point in the history
  • Loading branch information
cjgillot committed Jul 2, 2024
1 parent 585fe45 commit 9b82411
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion compiler/rustc_resolve/src/def_collector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,9 @@ impl<'a, 'b, 'tcx> DefCollector<'a, 'b, 'tcx> {

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

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

0 comments on commit 9b82411

Please sign in to comment.