[−][src]Enum rustc_codegen_llvm::mono_item::MonoItem
Variants
Fn(Instance<'tcx>)Static(DefId)GlobalAsm(HirId)Implementations
impl<'tcx> MonoItem<'tcx>[src]
pub fn size_estimate(&self, tcx: TyCtxt<'tcx>) -> usize[src]
pub fn is_generic_fn(&self) -> bool[src]
pub fn symbol_name(&self, tcx: TyCtxt<'tcx>) -> SymbolName<'tcx>[src]
pub fn instantiation_mode(&self, tcx: TyCtxt<'tcx>) -> InstantiationMode[src]
pub fn explicit_linkage(&self, tcx: TyCtxt<'tcx>) -> Option<Linkage>[src]
pub fn is_instantiable(&self, tcx: TyCtxt<'tcx>) -> bool[src]
Returns true if this instance is instantiable - whether it has no unsatisfied
predicates.
In order to codegen an item, all of its predicates must hold, because otherwise the item does not make sense. Type-checking ensures that the predicates of every item that is used by a valid item do hold, so we can rely on that.
However, we codegen collector roots (reachable items) and functions in vtables when they are seen, even if they are not used, and so they might not be instantiable. For example, a programmer can define this public function:
pub fn foo<'a>(s: &'a mut ()) where &'a mut (): Clone { <&mut () as Clone>::clone(&s); }
That function can't be codegened, because the method <&mut () as Clone>::clone
does not exist. Luckily for us, that function can't ever be used,
because that would require for &'a mut (): Clone to hold, so we
can just not emit any code, or even a linker reference for it.
Similarly, if a vtable method has such a signature, and therefore can't be used, we can just not emit it and have a placeholder (a null pointer, which will never be accessed) in its place.
pub fn to_string(&self, tcx: TyCtxt<'tcx>, debug: bool) -> String[src]
pub fn local_span(&self, tcx: TyCtxt<'tcx>) -> Option<Span>[src]
Trait Implementations
impl<'tcx> Clone for MonoItem<'tcx>[src]
impl<'tcx> Copy for MonoItem<'tcx>[src]
impl<'tcx> Debug for MonoItem<'tcx>[src]
impl<'tcx> Eq for MonoItem<'tcx>[src]
impl<'tcx> Hash for MonoItem<'tcx>[src]
fn hash<__H>(&self, state: &mut __H) where
__H: Hasher, [src]
__H: Hasher,
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher, 1.3.0[src]
H: Hasher,
impl<'tcx> PartialEq<MonoItem<'tcx>> for MonoItem<'tcx>[src]
Auto Trait Implementations
impl<'tcx> !RefUnwindSafe for MonoItem<'tcx>
impl<'tcx> !Send for MonoItem<'tcx>
impl<'tcx> !Sync for MonoItem<'tcx>
impl<'tcx> Unpin for MonoItem<'tcx>
impl<'tcx> !UnwindSafe for MonoItem<'tcx>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T[src]
fn clone_into(&self, target: &mut T)[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,