diff options
| author | bjorn3 <17426603+bjorn3@users.noreply.github.com> | 2024-12-13 09:52:38 +0000 |
|---|---|---|
| committer | bjorn3 <17426603+bjorn3@users.noreply.github.com> | 2025-05-28 20:55:00 +0000 |
| commit | 0fd257d66ca761c5eba965fac52acffe3a8a7d96 (patch) | |
| tree | 6311aa4556fa551783158748c2ccf3fc7f8c1603 /compiler/rustc_codegen_ssa/src | |
| parent | a4cb1c72c521a1300a3a88d46b721677e1380e3d (diff) | |
| download | rust-0fd257d66ca761c5eba965fac52acffe3a8a7d96.tar.gz rust-0fd257d66ca761c5eba965fac52acffe3a8a7d96.zip | |
Remove a couple of uses of interior mutability around statics
Diffstat (limited to 'compiler/rustc_codegen_ssa/src')
| -rw-r--r-- | compiler/rustc_codegen_ssa/src/traits/statics.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/rustc_codegen_ssa/src/traits/statics.rs b/compiler/rustc_codegen_ssa/src/traits/statics.rs index ece0ea1b2ea..a11a1ca4d03 100644 --- a/compiler/rustc_codegen_ssa/src/traits/statics.rs +++ b/compiler/rustc_codegen_ssa/src/traits/statics.rs @@ -5,11 +5,11 @@ use super::BackendTypes; pub trait StaticCodegenMethods: BackendTypes { fn static_addr_of(&self, cv: Self::Value, align: Align, kind: Option<&str>) -> Self::Value; - fn codegen_static(&self, def_id: DefId); + fn codegen_static(&mut 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. - fn add_used_global(&self, global: Self::Value); + fn add_used_global(&mut self, global: Self::Value); /// Same as add_used_global(), but only prevent the compiler from potentially removing an /// otherwise unused symbol. The linker is still permitted to drop it. @@ -17,7 +17,7 @@ pub trait StaticCodegenMethods: BackendTypes { /// This corresponds to the documented semantics of the `#[used]` attribute, although /// on some targets (non-ELF), we may use `add_used_global` for `#[used]` statics /// instead. - fn add_compiler_used_global(&self, global: Self::Value); + fn add_compiler_used_global(&mut self, global: Self::Value); } pub trait StaticBuilderMethods: BackendTypes { |
