Skip to content

Commit 74e774e

Browse files
Handle "false where clause" with TooGeneric layout error
Signed-off-by: FedericoBruzzone <[email protected]>
1 parent 5de4857 commit 74e774e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

compiler/rustc_ty_utils/src/layout.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,11 @@ fn map_error<'tcx>(
109109
"encountered unexpected unsized field in layout of {ty:?}: {field:#?}"
110110
));
111111
}
112-
LayoutError::Unknown(ty)
112+
if cx.tcx().features().trivial_bounds() {
113+
LayoutError::TooGeneric(ty)
114+
} else {
115+
LayoutError::Unknown(ty)
116+
}
113117
}
114118
LayoutCalculatorError::EmptyUnion => {
115119
// This is always a compile error.

0 commit comments

Comments
 (0)