-
Notifications
You must be signed in to change notification settings - Fork 12.9k
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: unexpected inference var
#123141
Comments
This could be minimized further @rustbot label: E-needs-mcve |
Minimized a bit more struct Foo<const N: usize>;
trait Bar {
type Item;
fn c() -> Self::Item;
}
impl<const N: usize> Bar for Foo<{ rem }> {
type Item = Foo<N>;
}
fn main() {
let _: Foo<0> = <Foo<0> as Bar>::c();
} |
the same cause as #122638 |
Here is a reproduction using type parameters instead of const parameters and with a minimal amount of unrelated errors and no feature gates: trait Trait {
fn next(self) -> Self::Item;
type Item;
}
struct Foo<T: ?Sized>(T);
impl<T: ?Sized, U> Trait for Foo<U> {
type Item = Foo<T>;
fn next(self) -> Self::Item {
loop {}
}
}
fn opaque() -> impl Trait {
Foo::<_>(10_u32)
}
fn main() {
opaque().next();
} In order for this to reproduce the unconstrained generic parameter must not have any bounds involving it that would not succeed if it were an inference variable. For example without the The root cause here is that we attempt to normalize using the Program output
|
auto-reduced (treereduce-rust):
original:
Version information
Command:
/home/matthias/.rustup/toolchains/master/bin/rustc
Program output
The text was updated successfully, but these errors were encountered: