Skip to content

Commit 7591ec4

Browse files
committed
Auto merge of rust-lang#128703 - compiler-errors:normalizing-tails, r=lcnr
Miscellaneous improvements to struct tail normalization 1. Make checks for foreign tails more accurate by normalizing the struct tail. I didn't write a test for this one. 2. Normalize when computing struct tail for `offset_of` for slice/str. This fixes the new solver only. 3. Normalizing when computing tails for disaligned reference check. This fixes both solvers. r? lcnr
2 parents 1ac76a2 + 6ce7e6d commit 7591ec4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

clippy_utils/src/qualify_min_const_fn.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ fn check_rvalue<'tcx>(
142142
// We cannot allow this for now.
143143
return Err((span, "unsizing casts are only allowed for references right now".into()));
144144
};
145-
let unsized_ty = tcx.struct_tail_erasing_lifetimes(pointee_ty, tcx.param_env(def_id));
145+
let unsized_ty = tcx.struct_tail_for_codegen(pointee_ty, tcx.param_env(def_id));
146146
if let ty::Slice(_) | ty::Str = unsized_ty.kind() {
147147
check_operand(tcx, op, span, body, msrv)?;
148148
// Casting/coercing things to slices is fine.

0 commit comments

Comments
 (0)