Skip to content

Commit 53fe5ec

Browse files
committed
ICE to delayed bug
1 parent 5c2f20d commit 53fe5ec

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

compiler/rustc_ty_utils/src/layout.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -777,7 +777,9 @@ fn layout_of_uncached<'tcx>(
777777
let err = if ty.has_param() || !cx.typing_env.param_env.caller_bounds().is_empty() {
778778
LayoutError::TooGeneric(ty)
779779
} else {
780-
unreachable!("invalid rigid alias in layout_of after normalization: {ty:?}");
780+
LayoutError::ReferencesError(cx.tcx().dcx().delayed_bug(format!(
781+
"unexected rigid alias in layout_of after normalization: {ty:?}"
782+
)))
781783
};
782784
return Err(error(cx, err));
783785
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
error[E0046]: not all trait items implemented, missing: `Assoc`
2+
--> $DIR/rigid-alias-due-to-broken-impl.rs:14:1
3+
|
4+
LL | type Assoc;
5+
| ---------- `Assoc` from trait
6+
...
7+
LL | impl Foo for str {}
8+
| ^^^^^^^^^^^^^^^^ missing `Assoc` in implementation
9+
10+
error: aborting due to 1 previous error
11+
12+
For more information about this error, try `rustc --explain E0046`.

0 commit comments

Comments
 (0)