-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
struct in type of const param causes ICE #74199
Comments
@lcnr I would like to fix it. Can you please guide me? |
I am not completely sure what's going wrong here myself yet. I will try to look into what we can do here soon. If you open a new topic on zulip we can discuss it there. |
Not completely sure why this ICEs after the cycle error, will have to ask about this myself. rust/src/librustc_typeck/variance/constraints.rs Lines 164 to 169 in 7d31ffc
The cycle error itself seems like a quite difficult problem though x.x #![feature(const_generics)]
struct Bar<T>(T);
impl<T> Bar<T> {
const fn value() -> usize {
42
}
}
struct Foo<const N: [u8; Bar::<u32>::value()]>; I don't have the time to think too much about this, but the short overview is the following:
This luckily is outside of |
Fix Const-Generic Cycle ICE rust-lang#74199 This PR intends to fix the bug in Issue rust-lang#74199 by following the suggestion provided of ignoring the error that causes the ICE. This does not fix the underlying cycle detection issue, but fixes the ICE. Also adds a test to check that it doesn't causes an ICE but returns a valid error for now. r? @lcnr Edit: Also it's funny how this PR number is an anagram of the issue number
Rollup of 6 pull requests Successful merges: - rust-lang#74644 (Remove `linked_list_extras` methods.) - rust-lang#74968 (Run all tests if have no specified tests) - rust-lang#74982 (1.45.2 release notes) - rust-lang#74984 (Miri: fix ICE when unwinding past topmost stack frame) - rust-lang#74986 (fix part of comparison that would always evaluate to "true", probably an oversight) - rust-lang#74991 (Fix Const-Generic Cycle ICE rust-lang#74199) Failed merges: r? @ghost
Fixed by #74991 |
This shouldn't error, will open a new issue for that |
causes an ICE with
The text was updated successfully, but these errors were encountered: