about summary refs log tree commit diff
path: root/compiler/rustc_mir_transform/src
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2025-02-07 12:01:59 +0100
committerGitHub <noreply@github.com>2025-02-07 12:01:59 +0100
commit5df99b0bd2fc05087c322d5db4d5a2d37428c888 (patch)
tree50521ac8cf61840aaca1168402d157000b788760 /compiler/rustc_mir_transform/src
parent8b69cf19835fccc8507d562cc102a07b140cd74f (diff)
parent5934e0afeff267d58a6449f10a263f9f1ad8f847 (diff)
downloadrust-5df99b0bd2fc05087c322d5db4d5a2d37428c888.tar.gz
rust-5df99b0bd2fc05087c322d5db4d5a2d37428c888.zip
Rollup merge of #136627 - RalfJung:mir-validation-cfg-checker, r=compiler-errors
MIR validation: add comment explaining the limitations of CfgChecker

I hope this right but I am not sure.^^
Cc `@compiler-errors` `@lcnr` `@cjgillot` `@oli-obk`
Diffstat (limited to 'compiler/rustc_mir_transform/src')
-rw-r--r--compiler/rustc_mir_transform/src/validate.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/compiler/rustc_mir_transform/src/validate.rs b/compiler/rustc_mir_transform/src/validate.rs
index b7a3770fc6b..4ac3a268c9c 100644
--- a/compiler/rustc_mir_transform/src/validate.rs
+++ b/compiler/rustc_mir_transform/src/validate.rs
@@ -97,6 +97,12 @@ impl<'tcx> crate::MirPass<'tcx> for Validator {
     }
 }
 
+/// This checker covers basic properties of the control-flow graph, (dis)allowed statements and terminators.
+/// Everything checked here must be stable under substitution of generic parameters. In other words,
+/// this is about the *structure* of the MIR, not the *contents*.
+///
+/// Everything that depends on types, or otherwise can be affected by generic parameters,
+/// must be checked in `TypeChecker`.
 struct CfgChecker<'a, 'tcx> {
     when: &'a str,
     body: &'a Body<'tcx>,