Enum rustc_middle::mir::mono::MonoItem [−][src]
Variants
Fn(Instance<'tcx>)Static(DefId)GlobalAsm(ItemId)Implementations
impl<'tcx> MonoItem<'tcx>[src]
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]
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]
pub fn codegen_dep_node(&self, tcx: TyCtxt<'tcx>) -> DepNode[src]
Trait Implementations
impl<'a, 'tcx> HashStable<StableHashingContext<'a>> for MonoItem<'tcx>[src]
impl<'a, 'tcx> HashStable<StableHashingContext<'a>> for MonoItem<'tcx>[src]fn hash_stable(
&self,
hcx: &mut StableHashingContext<'a>,
hasher: &mut StableHasher
)[src]
&self,
hcx: &mut StableHashingContext<'a>,
hasher: &mut StableHasher
)
impl<'tcx> Copy for MonoItem<'tcx>[src]
impl<'tcx> Eq for MonoItem<'tcx>[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<'tcx, T> ArenaAllocatable<'tcx, ()> for T where
T: Copy, [src]
impl<'tcx, T> ArenaAllocatable<'tcx, ()> for T where
T: Copy, [src]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> BorrowMut<T> for T where
T: ?Sized, [src]
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]pub fn borrow_mut(&mut self) -> &mut T[src]
pub fn borrow_mut(&mut self) -> &mut T[src]Mutably borrows from an owned value. Read more
impl<T> MaybeResult<T> for T[src]
impl<T> MaybeResult<T> for T[src]impl<T> ToOwned for T where
T: Clone, [src]
impl<T> ToOwned for T where
T: Clone, [src]type Owned = T
type Owned = TThe resulting type after obtaining ownership.
pub fn to_owned(&self) -> T[src]
pub fn to_owned(&self) -> T[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)[src]
pub fn clone_into(&self, target: &mut T)[src]🔬 This is a nightly-only experimental API. (toowned_clone_into)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
impl<T> WithConstness for T[src]
impl<T> WithConstness for T[src]fn with_constness(self, constness: Constness) -> ConstnessAnd<Self>[src]
fn with_const(self) -> ConstnessAnd<Self>[src]
fn without_const(self) -> ConstnessAnd<Self>[src]
impl<'a, T> Captures<'a> for T where
T: ?Sized, [src]
T: ?Sized,