From 3463d0fb8b8f66ca8b397a30d835cd0dfbc7a443 Mon Sep 17 00:00:00 2001 From: FedericoBruzzone Date: Mon, 6 Jan 2025 12:03:30 +0100 Subject: [PATCH] Change wrong assertion which causes ICE Signed-off-by: FedericoBruzzone --- compiler/rustc_ty_utils/src/layout.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/rustc_ty_utils/src/layout.rs b/compiler/rustc_ty_utils/src/layout.rs index 22916fd5c62e..9d54976db696 100644 --- a/compiler/rustc_ty_utils/src/layout.rs +++ b/compiler/rustc_ty_utils/src/layout.rs @@ -104,7 +104,7 @@ fn map_error<'tcx>( // This is sometimes not a compile error if there are trivially false where clauses. // See `tests/ui/layout/trivial-bounds-sized.rs` for an example. assert!(field.layout.is_unsized(), "invalid layout error {err:#?}"); - if !field.ty.is_sized(cx.tcx(), cx.typing_env) { + if cx.typing_env.param_env.caller_bounds().is_empty() { cx.tcx().dcx().delayed_bug(format!( "encountered unexpected unsized field in layout of {ty:?}: {field:#?}" ));