-
Notifications
You must be signed in to change notification settings - Fork 13.3k
ICE "const parameter out of range" with duplicated const param name in trait #104312
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
Here's a simpler case that ICEs in a similar way. It ICEd at least as far back as nightly-2018-01-01 (with the trait Foo<A, A = A> {}
type Bar<T> = dyn Foo<T>;
fn main() {} Output:
Full output
|
A similar thing was fixed a week ago in #103790 but maybe a more general fix is needed. |
This fix probably needs to go into the resolver -- Using
I think the issue is that |
Similar ICE with struct instead of impl trait: struct Foo<const M: u8, const M: u8 = M>();
fn a(x: Foo<0>) {}
fn main() {} |
This would be inconsistent with how lifetimes work. You can have |
Skip recording resolution for duplicated generic params. Turns out the fix was simpler than I thought. Fixes rust-lang/rust#104312
Found with a modified fuzz-rustc
Code
Error output
Full output including backtrace
Regression
Regression in nightly-2021-04-26, possibly from #84299 (@lcnr)
Version
@rustbot label +A-const-generics
The text was updated successfully, but these errors were encountered: