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