Skip to content

Commit

Permalink
Monomorphize type of promoted
Browse files Browse the repository at this point in the history
  • Loading branch information
bjorn3 committed Dec 18, 2019
1 parent 79ec894 commit 8d2db1b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -616,11 +616,13 @@ pub fn trans_place<'tcx>(
PlaceBase::Local(local) => fx.get_local_place(*local),
PlaceBase::Static(static_) => match static_.kind {
StaticKind::Static => {
// Statics can't be generic, so `static_.ty` doesn't need to be monomorphized.
crate::constant::codegen_static_ref(fx, static_.def_id, static_.ty)
}
StaticKind::Promoted(promoted, substs) => {
let instance = Instance::new(static_.def_id, fx.monomorphize(&substs));
crate::constant::trans_promoted(fx, instance, promoted, static_.ty)
let ty = fx.monomorphize(&static_.ty);
crate::constant::trans_promoted(fx, instance, promoted, ty)
}
},
};
Expand Down

0 comments on commit 8d2db1b

Please sign in to comment.