Trait IsBody

Source
pub trait IsBody:
    Sized
    + Debug
    + Clone
    + 'static {
    // Required method
    fn body<'tcx, S: UnderOwnerState<'tcx>>(did: RDefId, s: &S) -> Option<Self>;

    // Provided method
    fn from_mir<'tcx, S: UnderOwnerState<'tcx>>(
        _s: &S,
        _body: Body<'tcx>,
    ) -> Option<Self> { ... }
}

Required Methods§

Source

fn body<'tcx, S: UnderOwnerState<'tcx>>(did: RDefId, s: &S) -> Option<Self>

Provided Methods§

Source

fn from_mir<'tcx, S: UnderOwnerState<'tcx>>( _s: &S, _body: Body<'tcx>, ) -> Option<Self>

Reuse a MIR body we already got. Panic if that’s impossible.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl IsBody for ()

Source§

fn body<'tcx, S: UnderOwnerState<'tcx>>(_did: RDefId, _s: &S) -> Option<Self>

Source§

fn from_mir<'tcx, S: UnderOwnerState<'tcx>>( _s: &S, _body: Body<'tcx>, ) -> Option<Self>

Source§

impl<A: IsBody, B: IsBody> IsBody for (A, B)

Source§

fn body<'tcx, S: UnderOwnerState<'tcx>>(did: RDefId, s: &S) -> Option<Self>

Implementors§

Source§

impl IsBody for ThirBody

Source§

impl<MirKind: IsMirKind + Clone + 'static> IsBody for MirBody<MirKind>