Rollup merge of #128712 - compiler-errors:normalize-borrowck, r=lcnr
Normalize struct tail properly for `dyn` ptr-to-ptr casting in new solver Realized that the new solver didn't handle ptr-to-ptr casting correctly. r? lcnr Built on #128694
This commit is contained in:
commit
4c49418472
15 changed files with 95 additions and 38 deletions
|
@ -226,7 +226,7 @@ pub(super) fn op_to_const<'tcx>(
|
|||
let pointee_ty = imm.layout.ty.builtin_deref(false).unwrap(); // `false` = no raw ptrs
|
||||
debug_assert!(
|
||||
matches!(
|
||||
ecx.tcx.struct_tail_without_normalization(pointee_ty).kind(),
|
||||
ecx.tcx.struct_tail_for_codegen(pointee_ty, ecx.param_env).kind(),
|
||||
ty::Str | ty::Slice(..),
|
||||
),
|
||||
"`ConstValue::Slice` is for slice-tailed types only, but got {}",
|
||||
|
|
|
@ -195,7 +195,7 @@ fn reconstruct_place_meta<'tcx>(
|
|||
|
||||
let mut last_valtree = valtree;
|
||||
// Traverse the type, and update `last_valtree` as we go.
|
||||
let tail = tcx.struct_tail_with_normalize(
|
||||
let tail = tcx.struct_tail_raw(
|
||||
layout.ty,
|
||||
|ty| ty,
|
||||
|| {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue