fix: return ealry when has tainted in mir-lint

This commit is contained in:
bohan 2023-09-08 01:39:26 +08:00
parent 1e746d7741
commit 967410c640
3 changed files with 34 additions and 0 deletions

View file

@ -39,6 +39,10 @@ pub struct ConstProp;
impl<'tcx> MirLint<'tcx> for ConstProp {
fn run_lint(&self, tcx: TyCtxt<'tcx>, body: &Body<'tcx>) {
if body.tainted_by_errors.is_some() {
return;
}
// will be evaluated by miri and produce its errors there
if body.source.promoted.is_some() {
return;