about summary refs log tree commit diff
diff options
context:
space:
mode:
authorDeadbeef <ent3rm4n@gmail.com>2022-10-28 11:46:12 +0000
committerDeadbeef <ent3rm4n@gmail.com>2022-10-28 12:03:24 +0000
commit678e67590a604aa65f9daed0bc7dcc22ed84796c (patch)
tree807fe55235d5e5ac78f960851d43fc19c3b9909f
parent6e6a8034b8e0777fcda908038114e3aebceb564c (diff)
downloadrust-678e67590a604aa65f9daed0bc7dcc22ed84796c.tar.gz
rust-678e67590a604aa65f9daed0bc7dcc22ed84796c.zip
Retain ParamEnv constness when running deferred cast checks
Fixes #103677.
-rw-r--r--clippy_lints/src/transmute/utils.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/clippy_lints/src/transmute/utils.rs b/clippy_lints/src/transmute/utils.rs
index 2f190e594a8..641cdf5d330 100644
--- a/clippy_lints/src/transmute/utils.rs
+++ b/clippy_lints/src/transmute/utils.rs
@@ -3,6 +3,7 @@ use rustc_hir_typeck::{cast, FnCtxt, Inherited};
 use rustc_lint::LateContext;
 use rustc_middle::ty::{cast::CastKind, Ty};
 use rustc_span::DUMMY_SP;
+use rustc_hir as hir;
 
 // check if the component types of the transmuted collection and the result have different ABI,
 // size or alignment
@@ -56,7 +57,7 @@ fn check_cast<'tcx>(cx: &LateContext<'tcx>, e: &'tcx Expr<'_>, from_ty: Ty<'tcx>
         if let Ok(check) = cast::CastCheck::new(
             &fn_ctxt, e, from_ty, to_ty,
             // We won't show any error to the user, so we don't care what the span is here.
-            DUMMY_SP, DUMMY_SP,
+            DUMMY_SP, DUMMY_SP, hir::Constness::NotConst,
         ) {
             let res = check.do_check(&fn_ctxt);