From 4a1289195da747f6a2cfe989aa9811f7869926f6 Mon Sep 17 00:00:00 2001 From: Camille GILLOT Date: Mon, 18 Sep 2023 17:26:45 +0000 Subject: [PATCH] Expand doc comment on MIR validation. --- compiler/rustc_const_eval/src/transform/validate.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/compiler/rustc_const_eval/src/transform/validate.rs b/compiler/rustc_const_eval/src/transform/validate.rs index 2f5f2ad6534ad..a57182955a09f 100644 --- a/compiler/rustc_const_eval/src/transform/validate.rs +++ b/compiler/rustc_const_eval/src/transform/validate.rs @@ -1,4 +1,14 @@ //! Validates the MIR to ensure that invariants are upheld. +//! +//! The checks are split in two visitors: CfgChecker and TypeChecker. +//! +//! CfgChecker is meant to verify MIR syntax: control flow of cleanup blocks, allowed/disallowed +//! statements and terminators... +//! +//! TypeChecker is meant to verify MIR types. It is used by the inliner to verify that type +//! instanciation do not mess things up (for instance #112332 and earlier instances). +//! +//! If a check depends on types, it should go in TypeChecker, otherwise it can go in CfgChecker. use rustc_data_structures::fx::{FxHashMap, FxHashSet}; use rustc_index::bit_set::BitSet;