Check whether a static is mutable instead of passing it down
This commit is contained in:
parent
f0fa06bb7a
commit
0ef52380a5
4 changed files with 9 additions and 9 deletions
|
@ -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);
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue