ICE to delayed bug

(cherry picked from commit b3d9fbc17271a03bdd3ccbf95bb296b3505d4120)
This commit is contained in:
lcnr
2026-02-13 12:52:05 +00:00
committed by Josh Stone
parent 2e724d4f36
commit fe9b522a7b
2 changed files with 15 additions and 1 deletions
+3 -1
View File
@@ -777,7 +777,9 @@ fn layout_of_uncached<'tcx>(
let err = if ty.has_param() || !cx.typing_env.param_env.caller_bounds().is_empty() {
LayoutError::TooGeneric(ty)
} else {
unreachable!("invalid rigid alias in layout_of after normalization: {ty:?}");
LayoutError::ReferencesError(cx.tcx().dcx().delayed_bug(format!(
"unexpected rigid alias in layout_of after normalization: {ty:?}"
)))
};
return Err(error(cx, err));
}
@@ -0,0 +1,12 @@
error[E0046]: not all trait items implemented, missing: `Assoc`
--> $DIR/rigid-alias-due-to-broken-impl.rs:14:1
|
LL | type Assoc;
| ---------- `Assoc` from trait
...
LL | impl Foo for str {}
| ^^^^^^^^^^^^^^^^ missing `Assoc` in implementation
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0046`.