Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of #117414 - compiler-errors:tait-forevert, r=oli-obk
Don't normalize to an un-revealed opaque when we hit the recursion limit Currently, we will normalize `Opaque := Option<&Opaque>` to something like `Option<&Option<&Option<&...Opaque>>>`, hitting a limit and bottoming out in an unnormalized opaque after the recursion limit gets hit. Unfortunately, during `layout_of`, we'll simply recurse and try again if the type normalizes to something different than the type: https://github.com/rust-lang/rust/blob/e6e931dda5fffbae0fd87c5b1af753cc95556880/compiler/rustc_ty_utils/src/layout.rs#L58-L60 That means then we'll try to normalize `Option<&Option<&Option<&...Opaque>>>` again, substituting `Opaque` into itself even deeper. Eventually this will get to the point that we're just stack-overflowing on a really deep type before even hitting an opaque again. To fix this, we just bottom out into `ty::Error` instead of the unrevealed opaque type. Fixes #117412 r? `@oli-obk`
- Loading branch information