diff options
| author | bjorn3 <bjorn3@users.noreply.github.com> | 2018-12-02 14:35:11 +0100 |
|---|---|---|
| committer | bjorn3 <bjorn3@users.noreply.github.com> | 2019-03-29 17:17:12 +0100 |
| commit | a0056333f12ae3b916fbd0a14c1b641460140797 (patch) | |
| tree | 1a1cea653ac0a3a57d2e545d6fc9bd1881b57152 | |
| parent | fe88440bd2aa2647d41ed33193ce5eac682afa17 (diff) | |
| download | rust-a0056333f12ae3b916fbd0a14c1b641460140797.tar.gz rust-a0056333f12ae3b916fbd0a14c1b641460140797.zip | |
Misc
| -rw-r--r-- | src/librustc_codegen_llvm/builder.rs | 2 | ||||
| -rw-r--r-- | src/librustc_codegen_ssa/mir/place.rs | 5 | ||||
| -rw-r--r-- | src/librustc_codegen_ssa/traits/statics.rs | 2 |
3 files changed, 5 insertions, 4 deletions
diff --git a/src/librustc_codegen_llvm/builder.rs b/src/librustc_codegen_llvm/builder.rs index 048adb0fb80..ebe3a81acc6 100644 --- a/src/librustc_codegen_llvm/builder.rs +++ b/src/librustc_codegen_llvm/builder.rs @@ -1471,7 +1471,7 @@ impl BuilderMethods<'a, 'tcx> for Builder<'a, 'll, 'tcx> { } impl StaticBuilderMethods<'tcx> for Builder<'a, 'll, 'tcx> { - fn get_static(&self, def_id: DefId) -> &'ll Value { + fn get_static(&mut self, def_id: DefId) -> &'ll Value { // Forward to the `get_static` method of `CodegenCx` self.cx().get_static(def_id) } diff --git a/src/librustc_codegen_ssa/mir/place.rs b/src/librustc_codegen_ssa/mir/place.rs index 7cafa0088a0..bf2afbbabab 100644 --- a/src/librustc_codegen_ssa/mir/place.rs +++ b/src/librustc_codegen_ssa/mir/place.rs @@ -80,7 +80,7 @@ impl<'a, 'tcx: 'a, V: CodegenObject> PlaceRef<'tcx, V> { Self::alloca(bx, ptr_layout, name) } - pub fn len<Cx: CodegenMethods<'tcx, Value = V>>( + pub fn len<Cx: ConstMethods<'tcx, Value = V>>( &self, cx: &Cx ) -> V { @@ -447,7 +447,8 @@ impl<'a, 'tcx: 'a, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> { // NB: The layout of a static may be unsized as is the case when working // with a static that is an extern_type. let layout = cx.layout_of(self.monomorphize(&ty)); - PlaceRef::new_thin_place(bx, bx.get_static(def_id), layout, layout.align.abi) + let static_ = bx.get_static(def_id); + PlaceRef::new_thin_place(bx, static_, layout, layout.align.abi) }, mir::Place::Projection(box mir::Projection { ref base, diff --git a/src/librustc_codegen_ssa/traits/statics.rs b/src/librustc_codegen_ssa/traits/statics.rs index c4e7fe703c2..55c1253f106 100644 --- a/src/librustc_codegen_ssa/traits/statics.rs +++ b/src/librustc_codegen_ssa/traits/statics.rs @@ -8,5 +8,5 @@ pub trait StaticMethods: BackendTypes { } pub trait StaticBuilderMethods<'tcx>: BackendTypes { - fn get_static(&self, def_id: DefId) -> Self::Value; + fn get_static(&mut self, def_id: DefId) -> Self::Value; } |
