Skip to content

Commit 8d2db1b

Browse files
committed
Monomorphize type of promoted
1 parent 79ec894 commit 8d2db1b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/base.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -616,11 +616,13 @@ pub fn trans_place<'tcx>(
616616
PlaceBase::Local(local) => fx.get_local_place(*local),
617617
PlaceBase::Static(static_) => match static_.kind {
618618
StaticKind::Static => {
619+
// Statics can't be generic, so `static_.ty` doesn't need to be monomorphized.
619620
crate::constant::codegen_static_ref(fx, static_.def_id, static_.ty)
620621
}
621622
StaticKind::Promoted(promoted, substs) => {
622623
let instance = Instance::new(static_.def_id, fx.monomorphize(&substs));
623-
crate::constant::trans_promoted(fx, instance, promoted, static_.ty)
624+
let ty = fx.monomorphize(&static_.ty);
625+
crate::constant::trans_promoted(fx, instance, promoted, ty)
624626
}
625627
},
626628
};

0 commit comments

Comments
 (0)