Skip to main content

try_retrieve_mir_body

Function try_retrieve_mir_body 

Source
pub unsafe fn try_retrieve_mir_body<'tcx>(
    _tcx: TyCtxt<'tcx>,
    def_id: LocalDefId,
) -> Option<Rc<BodyWithBorrowckFacts<'tcx>>>
Expand description

Like retrieve_mir_body, but returns None instead of panicking when no body was stashed for def_id (e.g. a local item rustc never borrowchecks). The no-panic call-graph provider uses this to degrade such items to leaf nodes.

ยงSafety

See the module level comment.