diff options
| author | Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de> | 2023-10-06 15:00:44 +0000 |
|---|---|---|
| committer | Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de> | 2024-03-12 05:53:46 +0000 |
| commit | 0ef52380a58d7224fac71cc36e9e4c0dc99aec33 (patch) | |
| tree | 685b7aa563c7a58e1c645f5dadd15ce30f174b3e /compiler/rustc_codegen_ssa/src | |
| parent | f0fa06bb7a0fae8743e0b5b25ccd24e03ec2ef74 (diff) | |
| download | rust-0ef52380a58d7224fac71cc36e9e4c0dc99aec33.tar.gz rust-0ef52380a58d7224fac71cc36e9e4c0dc99aec33.zip | |
Check whether a static is mutable instead of passing it down
Diffstat (limited to 'compiler/rustc_codegen_ssa/src')
| -rw-r--r-- | compiler/rustc_codegen_ssa/src/mono_item.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_codegen_ssa/src/traits/statics.rs | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_codegen_ssa/src/mono_item.rs b/compiler/rustc_codegen_ssa/src/mono_item.rs index 1a4795c0213..7b7cdae0ed6 100644 --- a/compiler/rustc_codegen_ssa/src/mono_item.rs +++ b/compiler/rustc_codegen_ssa/src/mono_item.rs @@ -30,7 +30,7 @@ impl<'a, 'tcx: 'a> MonoItemExt<'a, 'tcx> for MonoItem<'tcx> { match *self { MonoItem::Static(def_id) => { - cx.codegen_static(def_id, cx.tcx().is_mutable_static(def_id)); + cx.codegen_static(def_id); } MonoItem::GlobalAsm(item_id) => { let item = cx.tcx().hir().item(item_id); diff --git a/compiler/rustc_codegen_ssa/src/traits/statics.rs b/compiler/rustc_codegen_ssa/src/traits/statics.rs index 413d31bb942..737d93fd80a 100644 --- a/compiler/rustc_codegen_ssa/src/traits/statics.rs +++ b/compiler/rustc_codegen_ssa/src/traits/statics.rs @@ -4,7 +4,7 @@ use rustc_target::abi::Align; pub trait StaticMethods: BackendTypes { fn static_addr_of(&self, cv: Self::Value, align: Align, kind: Option<&str>) -> Self::Value; - fn codegen_static(&self, def_id: DefId, is_mutable: bool); + fn codegen_static(&self, def_id: DefId); /// Mark the given global value as "used", to prevent the compiler and linker from potentially /// removing a static variable that may otherwise appear unused. |
