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
This commit is contained in:
Gurinder Singh 2024-02-17 10:44:46 +05:30
parent 405b22f1a3
commit 5010ca001c
29 changed files with 6967 additions and 738 deletions

View file

@ -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();