1
Fork 0

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`
This commit is contained in:
Matthias Krüger 2025-02-07 12:01:59 +01:00 committed by GitHub
commit 5df99b0bd2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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>,