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 e9ad039Copy full SHA for e9ad039
compiler/rustc_ast_lowering/src/lib.rs
@@ -220,6 +220,23 @@ struct SpanLowerer {
220
impl SpanLowerer {
221
fn lower(&self, span: Span) -> Span {
222
if self.is_incremental {
223
+ // early return
224
+ if span.parent().is_some_and(|i| i == self.def_id) {
225
+ return span;
226
+ }
227
+
228
+ // #[cfg(debug_assertions)]
229
+ // {
230
+ // if !span.is_dummy()
231
+ // && let Some(p) = span.parent()
232
233
+ // assert!(
234
+ // p != self.def_id,
235
+ // "duplicate span lowering detected, parent of span {span:?} was already set to {:?}",
236
+ // self.def_id
237
+ // );
238
+ // }
239
240
span.with_parent(Some(self.def_id))
241
} else {
242
// Do not make spans relative when not using incremental compilation.
0 commit comments