mirror of
https://github.com/rust-lang/rust.git
synced 2025-11-03 14:34:58 +00:00
The actual implementation remains in `rustc_mir_dataflow`, but this commit moves the `MirPass` impl to `rustc_mir_transform` and changes it to a `MirLint` (fixing a `FIXME` comment). (I originally tried moving the full implementation from `rustc_mir_dataflow` but I had some trait problems with `HasMoveData` and `RustcPeekAt` and `MaybeLiveLocals`. This commit was much smaller and simpler, but still will allow some follow-up cleanups.)
14 lines
310 B
Rust
14 lines
310 B
Rust
use rustc_middle::mir::Body;
|
|
use rustc_middle::ty::TyCtxt;
|
|
use rustc_mir_dataflow::rustc_peek::sanity_check;
|
|
|
|
use crate::MirLint;
|
|
|
|
pub(super) struct SanityCheck;
|
|
|
|
impl<'tcx> MirLint<'tcx> for SanityCheck {
|
|
fn run_lint(&self, tcx: TyCtxt<'tcx>, body: &Body<'tcx>) {
|
|
sanity_check(tcx, body);
|
|
}
|
|
}
|