summary refs log tree commit diff
path: root/compiler/rustc_mir_transform/src
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2023-09-08 14:10:52 +0200
committerGitHub <noreply@github.com>2023-09-08 14:10:52 +0200
commit60327bb8b084a5d4b85bde71d6c7066804b6d2e2 (patch)
treedd3650f2dcdb99e49faa58f6a986fc886cd9f96f /compiler/rustc_mir_transform/src
parent575c3633f8bd4694d62ba47305f2b8818f5f7a9c (diff)
parent967410c64031002500534863b8d945b9f21bb1c8 (diff)
downloadrust-60327bb8b084a5d4b85bde71d6c7066804b6d2e2.tar.gz
rust-60327bb8b084a5d4b85bde71d6c7066804b6d2e2.zip
Rollup merge of #115643 - bvanjoi:fix-115203, r=RalfJung,oli-obk
fix: return early when has tainted in mir-lint

Fixes #115203

`a[..]` is of indeterminate size, it had been reported error during borrow check, therefore we skip the mir lint process.
Diffstat (limited to 'compiler/rustc_mir_transform/src')
-rw-r--r--compiler/rustc_mir_transform/src/const_prop_lint.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/compiler/rustc_mir_transform/src/const_prop_lint.rs b/compiler/rustc_mir_transform/src/const_prop_lint.rs
index 4b51beed095..b52827a1e88 100644
--- a/compiler/rustc_mir_transform/src/const_prop_lint.rs
+++ b/compiler/rustc_mir_transform/src/const_prop_lint.rs
@@ -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;