Skip to content

Commit b9295f1

Browse files
committed
Rustup to rustc 1.35.0-nightly (fbd34efb3 2019-03-26)
1 parent 0df3b41 commit b9295f1

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

src/base.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1135,8 +1135,14 @@ pub fn trans_place<'a, 'tcx: 'a>(
11351135
match place {
11361136
Place::Base(base) => match base {
11371137
PlaceBase::Local(local) => fx.get_local_place(*local),
1138-
PlaceBase::Promoted(data) => crate::constant::trans_promoted(fx, data.0, data.1),
1139-
PlaceBase::Static(static_) => crate::constant::codegen_static_ref(fx, static_),
1138+
PlaceBase::Static(static_) => match static_.kind {
1139+
StaticKind::Static(def_id) => {
1140+
crate::constant::codegen_static_ref(fx, def_id, static_.ty)
1141+
}
1142+
StaticKind::Promoted(promoted) => {
1143+
crate::constant::trans_promoted(fx, promoted, static_.ty)
1144+
}
1145+
}
11401146
}
11411147
Place::Projection(projection) => {
11421148
let base = trans_place(fx, &projection.base);

src/constant.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,12 @@ pub fn codegen_static<'a, 'tcx: 'a>(ccx: &mut ConstantCx, def_id: DefId) {
4444

4545
pub fn codegen_static_ref<'a, 'tcx: 'a>(
4646
fx: &mut FunctionCx<'a, 'tcx, impl Backend>,
47-
static_: &Static<'tcx>,
47+
def_id: DefId,
48+
ty: Ty<'tcx>,
4849
) -> CPlace<'tcx> {
49-
let linkage = crate::linkage::get_static_ref_linkage(fx.tcx, static_.def_id);
50-
let data_id = data_id_for_static(fx.tcx, fx.module, static_.def_id, linkage);
51-
cplace_for_dataid(fx, static_.ty, data_id)
50+
let linkage = crate::linkage::get_static_ref_linkage(fx.tcx, def_id);
51+
let data_id = data_id_for_static(fx.tcx, fx.module, def_id, linkage);
52+
cplace_for_dataid(fx, ty, data_id)
5253
}
5354

5455
pub fn trans_promoted<'a, 'tcx: 'a>(

0 commit comments

Comments
 (0)