-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ICE with higher-ranked nested RPIT #97099
Comments
This the the error-to-ICE regresion version of #96194 (comment) #97039 isn't intended to reject this case and there's no tracking issue of this ICE, so @rustbot label regression-from-stable-to-beta A-impl-trait A-lifetimes T-compiler |
Note that the error is correct here. If the inner opaque type is intended to capture fn blah() -> impl for<'a> Trait<'a, Assoc = impl Sized + 'a> { But then it's rejected as unsupported as per #97039. |
Assigning priority as discussed in the Zulip thread of the Prioritization Working Group. @rustbot label -I-prioritize +P-medium |
I don't know if this is at all helpful, but I have stumbled across a slightly different way to trigger this panic that requires an extra level of impl-trait indirection to work: trait Trait<E> {
type Assoc;
}
struct Foo;
impl<'a> Trait<&'a ()> for Foo {
type Assoc = ();
}
fn foo() -> impl for<'a> Trait<&'a ()> {
Foo
}
fn bar() -> impl for<'a> Trait<&'a (), Assoc = impl Sized> {
foo()
} It compiles when I return This causes a panic both on stable and on the latest nightly (the above now seems to panic on stable as well) with the same error as above:
|
I arrived at this by trying to make #97098 work on stable. I don't know if the root cause is the same, since the ICE message is different I'm posting it anyway.
playground
It fails to build in stable (I think it should build though..?)
but It ICEs in latest nightly
The text was updated successfully, but these errors were encountered: