[−][src]Trait rustc_codegen_ssa::traits::StaticMethods

pub trait StaticMethods: BackendTypes {
    pub fn static_addr_of(
        &self,
        cv: Self::Value,
        align: Align,
        kind: Option<&str>
    ) -> Self::Value;
pub fn codegen_static(&self, def_id: DefId, is_mutable: bool);
pub fn add_used_global(&self, global: Self::Value); }

Required methods

pub fn static_addr_of(
    &self,
    cv: Self::Value,
    align: Align,
    kind: Option<&str>
) -> Self::Value
[src]

pub fn codegen_static(&self, def_id: DefId, is_mutable: bool)[src]

pub fn add_used_global(&self, global: Self::Value)[src]

Mark the given global value as "used", to prevent a backend from potentially removing a static variable that may otherwise appear unused.

Static variables in Rust can be annotated with the #[used] attribute to direct the rustc compiler to mark the variable as a "used global".

#[used]
static FOO: u32 = 0;
Loading content...

Implementors

Loading content...