[−][src]Enum rustc_middle::mir::mono::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 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> Display for MonoItem<'tcx>[src]
impl<'tcx> Eq for MonoItem<'tcx>[src]
impl<'tcx> Hash for MonoItem<'tcx>[src]
pub fn hash<__H: Hasher>(&self, state: &mut __H)[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher, 1.3.0[src]
H: Hasher,
impl<'a, 'tcx> HashStable<StableHashingContext<'a>> for MonoItem<'tcx>[src]
pub fn hash_stable(
&self,
hcx: &mut StableHashingContext<'a>,
hasher: &mut StableHasher
)[src]
&self,
hcx: &mut StableHashingContext<'a>,
hasher: &mut StableHasher
)
impl<'tcx> PartialEq<MonoItem<'tcx>> for MonoItem<'tcx>[src]
pub fn eq(&self, other: &MonoItem<'tcx>) -> bool[src]
pub fn ne(&self, other: &MonoItem<'tcx>) -> bool[src]
impl<'tcx> StructuralEq for MonoItem<'tcx>[src]
impl<'tcx> StructuralPartialEq 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<'tcx, T> ArenaAllocatable<'tcx, ()> for T where
T: Copy, [src]
T: Copy,
pub fn allocate_on(Self, &'a Arena<'tcx>) -> &'a mut T[src]
pub fn allocate_from_iter(
&'a Arena<'tcx>,
impl IntoIterator<Item = T>
) -> &'a mut [T][src]
&'a Arena<'tcx>,
impl IntoIterator<Item = T>
) -> &'a mut [T]
impl<T> Borrow<T> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T[src]
impl<'a, T> Captures<'a> for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> MaybeResult<T> for T[src]
type Error = !
pub fn from(Result<T, <T as MaybeResult<T>>::Error>) -> T[src]
pub fn to_result(self) -> Result<T, <T as MaybeResult<T>>::Error>[src]
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T[src]
pub fn clone_into(&self, target: &mut T)[src]
impl<T> ToString for T where
T: Display + ?Sized, [src]
T: Display + ?Sized,
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.
pub 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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.