mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-08 09:38:26 +03:00
Monomorphize type of promoted
This commit is contained in:
+3
-1
@@ -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)
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user