Skip to content

Commit a005633

Browse files
committed
Misc
1 parent fe88440 commit a005633

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

src/librustc_codegen_llvm/builder.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1471,7 +1471,7 @@ impl BuilderMethods<'a, 'tcx> for Builder<'a, 'll, 'tcx> {
14711471
}
14721472

14731473
impl StaticBuilderMethods<'tcx> for Builder<'a, 'll, 'tcx> {
1474-
fn get_static(&self, def_id: DefId) -> &'ll Value {
1474+
fn get_static(&mut self, def_id: DefId) -> &'ll Value {
14751475
// Forward to the `get_static` method of `CodegenCx`
14761476
self.cx().get_static(def_id)
14771477
}

src/librustc_codegen_ssa/mir/place.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ impl<'a, 'tcx: 'a, V: CodegenObject> PlaceRef<'tcx, V> {
8080
Self::alloca(bx, ptr_layout, name)
8181
}
8282

83-
pub fn len<Cx: CodegenMethods<'tcx, Value = V>>(
83+
pub fn len<Cx: ConstMethods<'tcx, Value = V>>(
8484
&self,
8585
cx: &Cx
8686
) -> V {
@@ -447,7 +447,8 @@ impl<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
447447
// NB: The layout of a static may be unsized as is the case when working
448448
// with a static that is an extern_type.
449449
let layout = cx.layout_of(self.monomorphize(&ty));
450-
PlaceRef::new_thin_place(bx, bx.get_static(def_id), layout, layout.align.abi)
450+
let static_ = bx.get_static(def_id);
451+
PlaceRef::new_thin_place(bx, static_, layout, layout.align.abi)
451452
},
452453
mir::Place::Projection(box mir::Projection {
453454
ref base,

src/librustc_codegen_ssa/traits/statics.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ pub trait StaticMethods: BackendTypes {
88
}
99

1010
pub trait StaticBuilderMethods<'tcx>: BackendTypes {
11-
fn get_static(&self, def_id: DefId) -> Self::Value;
11+
fn get_static(&mut self, def_id: DefId) -> Self::Value;
1212
}

0 commit comments

Comments
 (0)