about summary refs log tree commit diff
path: root/compiler
diff options
context:
space:
mode:
authorGurinder Singh <frederick.the.fool@gmail.com>2024-02-17 10:44:46 +0530
committerGurinder Singh <frederick.the.fool@gmail.com>2024-02-17 10:44:46 +0530
commit5010ca001cb7cad425b906136fe251e8d8192b2e (patch)
tree08851c04b747f9144044e26f2960381c2c2febf3 /compiler
parent405b22f1a3a39eef5f4698b3662097c8a4f6f5d0 (diff)
Enable `ConstPropLint` for promoteds
This fixes the issue wherein the lint didn't fire for promoteds
in the case of SHL/SHR operators in non-optimized builds
and all arithmetic operators in optimized builds
Diffstat (limited to 'compiler')
-rw-r--r--compiler/rustc_mir_transform/src/const_prop_lint.rs5
1 files changed, 0 insertions, 5 deletions
diff --git a/compiler/rustc_mir_transform/src/const_prop_lint.rs b/compiler/rustc_mir_transform/src/const_prop_lint.rs
index f8e6905282c..6212155a8fe 100644
--- a/compiler/rustc_mir_transform/src/const_prop_lint.rs
+++ b/compiler/rustc_mir_transform/src/const_prop_lint.rs
@@ -32,11 +32,6 @@ impl<'tcx> MirLint<'tcx> for ConstPropLint {
             return;
         }
 
-        // will be evaluated by miri and produce its errors there
-        if body.source.promoted.is_some() {
-            return;
-        }
-
         let def_id = body.source.def_id().expect_local();
         let def_kind = tcx.def_kind(def_id);
         let is_fn_like = def_kind.is_fn_like();