We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 1d6c526 + 0087253 commit fa1f706Copy full SHA for fa1f706
compiler/rustc_ast_lowering/src/lib.rs
@@ -225,6 +225,13 @@ struct SpanLowerer {
225
impl SpanLowerer {
226
fn lower(&self, span: Span) -> Span {
227
if self.is_incremental {
228
+ // early return: span lowering takes some time since it accesses the query dependency graph
229
+ // to make sure we rerun the right code paths when spans change. When we've already lowered a span,
230
+ // or don't have to, bail out ASAP.
231
+ if span.is_dummy() || span.parent().is_some_and(|i| i == self.def_id) {
232
+ return span;
233
+ }
234
+
235
span.with_parent(Some(self.def_id))
236
} else {
237
// Do not make spans relative when not using incremental compilation.
0 commit comments