Skip to content

Commit 0ef08fb

Browse files
Change wrong assertion which causes ICE
Signed-off-by: FedericoBruzzone <[email protected]>
1 parent 74e774e commit 0ef08fb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compiler/rustc_ty_utils/src/layout.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ fn map_error<'tcx>(
104104
// This is sometimes not a compile error if there are trivially false where clauses.
105105
// See `tests/ui/layout/trivial-bounds-sized.rs` for an example.
106106
assert!(field.layout.is_unsized(), "invalid layout error {err:#?}");
107-
if !field.ty.is_sized(cx.tcx(), cx.typing_env) {
107+
if cx.typing_env.param_env.caller_bounds().is_empty() {
108108
cx.tcx().dcx().delayed_bug(format!(
109109
"encountered unexpected unsized field in layout of {ty:?}: {field:#?}"
110110
));

0 commit comments

Comments
 (0)