diff options
| author | bors <bors@rust-lang.org> | 2022-10-28 19:28:41 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2022-10-28 19:28:41 +0000 |
| commit | 9565dfeb4e6225177bbe78f18cd48a7982f34401 (patch) | |
| tree | d6b77aaa61b3e1cbda708ef6fce2384e7d281782 /src/tools | |
| parent | 77e7b74ad5c0c449fa378faf5edf33dd2e6fed87 (diff) | |
| parent | a990b4c1d04921e346a8d56c0f0efed0121b4bce (diff) | |
| download | rust-9565dfeb4e6225177bbe78f18cd48a7982f34401.tar.gz rust-9565dfeb4e6225177bbe78f18cd48a7982f34401.zip | |
Auto merge of #103683 - fee1-dead-contrib:fix-deferred-cast-checks-constness, r=oli-obk
Retain ParamEnv constness when running deferred cast checks Fixes #103677.
Diffstat (limited to 'src/tools')
| -rw-r--r-- | src/tools/clippy/clippy_lints/src/transmute/utils.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/tools/clippy/clippy_lints/src/transmute/utils.rs b/src/tools/clippy/clippy_lints/src/transmute/utils.rs index 2f190e594a8..641cdf5d330 100644 --- a/src/tools/clippy/clippy_lints/src/transmute/utils.rs +++ b/src/tools/clippy/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); |
