Skip to content

Commit 02070be

Browse files
committed
Translate promoted source span
1 parent c94bbdb commit 02070be

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

frontend/exporter/src/types/new/full_def.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,8 @@ where
7878
predicates: GenericPredicates { predicates: vec![] },
7979
};
8080
let body = get_promoted_mir(tcx, rust_def_id, promoted_id.as_rust_promoted_id());
81+
source_span = Some(body.span);
82+
8183
let ty: Ty = body.local_decls[rustc_middle::mir::Local::ZERO]
8284
.ty
8385
.sinto(&state_with_id);
@@ -88,7 +90,7 @@ where
8890
body,
8991
};
9092

91-
source_span = None;
93+
// None of these make sense for a promoted constant.
9294
attributes = Default::default();
9395
visibility = Default::default();
9496
lang_item = Default::default();

0 commit comments

Comments
 (0)