hir_contains_unsafe

Function hir_contains_unsafe 

Source
pub fn hir_contains_unsafe(tcx: TyCtxt<'_>, body_id: BodyId) -> bool
Expand description

Fast HIR-level pre-check: does this function contain unsafe blocks or is it declared unsafe fn?

This is a cheap check that can quickly filter out functions that are entirely safe and have no unsafe operations of any kind.