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.
1 parent 2fcbda6 commit 0087253Copy full SHA for 0087253
compiler/rustc_ast_lowering/src/lib.rs
@@ -220,6 +220,13 @@ struct SpanLowerer {
220
impl SpanLowerer {
221
fn lower(&self, span: Span) -> Span {
222
if self.is_incremental {
223
+ // early return: span lowering takes some time since it accesses the query dependency graph
224
+ // to make sure we rerun the right code paths when spans change. When we've already lowered a span,
225
+ // or don't have to, bail out ASAP.
226
+ if span.is_dummy() || span.parent().is_some_and(|i| i == self.def_id) {
227
+ return span;
228
+ }
229
+
230
span.with_parent(Some(self.def_id))
231
} else {
232
// Do not make spans relative when not using incremental compilation.
0 commit comments