rustc_mir_transform::pass_manager

Trait MirLint

Source
pub(crate) trait MirLint<'tcx> {
    // Required method
    fn run_lint(&self, tcx: TyCtxt<'tcx>, body: &Body<'tcx>);

    // Provided methods
    fn name(&self) -> &'static str { ... }
    fn is_enabled(&self, _sess: &Session) -> bool { ... }
}
Expand description

Just like MirPass, except it cannot mutate Body, and MIR dumping is disabled (via the Lint adapter).

Required Methods§

Source

fn run_lint(&self, tcx: TyCtxt<'tcx>, body: &Body<'tcx>)

Provided Methods§

Source

fn name(&self) -> &'static str

Source

fn is_enabled(&self, _sess: &Session) -> bool

Implementors§

Source§

impl<'tcx> MirLint<'tcx> for CheckConstItemMutation

Source§

impl<'tcx> MirLint<'tcx> for CheckPackedRef

Source§

impl<'tcx> MirLint<'tcx> for CheckUndefinedTransmutes

Source§

impl<'tcx> MirLint<'tcx> for FunctionItemReferences

Source§

impl<'tcx> MirLint<'tcx> for KnownPanicsLint

Source§

impl<'tcx> MirLint<'tcx> for CheckLiveDrops

Source§

impl<'tcx> MirLint<'tcx> for SanityCheck