Skip to content

Commit 678e675

Browse files
committed
Retain ParamEnv constness when running deferred cast checks
Fixes rust-lang#103677.
1 parent 6e6a803 commit 678e675

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Diff for: clippy_lints/src/transmute/utils.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ use rustc_hir_typeck::{cast, FnCtxt, Inherited};
33
use rustc_lint::LateContext;
44
use rustc_middle::ty::{cast::CastKind, Ty};
55
use rustc_span::DUMMY_SP;
6+
use rustc_hir as hir;
67

78
// check if the component types of the transmuted collection and the result have different ABI,
89
// size or alignment
@@ -56,7 +57,7 @@ fn check_cast<'tcx>(cx: &LateContext<'tcx>, e: &'tcx Expr<'_>, from_ty: Ty<'tcx>
5657
if let Ok(check) = cast::CastCheck::new(
5758
&fn_ctxt, e, from_ty, to_ty,
5859
// We won't show any error to the user, so we don't care what the span is here.
59-
DUMMY_SP, DUMMY_SP,
60+
DUMMY_SP, DUMMY_SP, hir::Constness::NotConst,
6061
) {
6162
let res = check.do_check(&fn_ctxt);
6263

0 commit comments

Comments
 (0)