-
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: index out of bounds: the len is 0 but the index is 0 #67945
Comments
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
I looked into this briefly and found that on this line: Line 978 in ebbb2bf
...that
Digging a bit deeper, the generics appear to be empty because of the following lines: rust/src/librustc_typeck/collect.rs Lines 1006 to 1017 in ebbb2bf
I can confirm that adding |
What would be the consequences of always returning the DefId? |
It causes query cycle errors at the moment. |
Discussed at T-compiler meeting. Due to all the known examples being compile-time errors, the ICE here does not seem so strong a hazard as to warrant weekly visits during triage. (Certainly failing more gracefully would be great. But its not something we're going to e.g. block a release on.) Downgrading priority to P-medium. |
Some relevant examples. This gives an (incorrect) error on stable that use std::marker::PhantomData;
use std::mem::{self, MaybeUninit};
struct Bug<S> {
A: [(); {
let x: Option<S> = None;
0
}],
} This ICEs on stable: use std::marker::PhantomData;
use std::mem::{self, MaybeUninit};
struct Bug<S> {
A: [(); {
let x: Option<Box<S>> = None;
0
}],
} |
Is there a reason why we can't just disallow type parameters from appearing within constants during resolve, like we do for type parameters from outer functions? Obviously const generics/lazy normization willl loosen this rule. |
@Skinny121 good point, I imagine that might work. |
This comment was marked as resolved.
This comment was marked as resolved.
Triage: The two examples that Centril posted (#67945 (comment) and #67945 (comment)) are no longer ICEs in the latest nightly. Possibly related to #70825? |
Maybe we should just add tests then? |
Sounds good! I'll do later. |
Add some regression tests Closes rust-lang#29988 Closes rust-lang#34979 Pick up two snippets that have been fixed from rust-lang#67945 (shouldn't be closed yet!)
Add some regression tests Closes rust-lang#29988 Closes rust-lang#34979 Pick up two snippets that have been fixed from rust-lang#67945 (shouldn't be closed yet!)
Add some regression tests Closes rust-lang#29988 Closes rust-lang#34979 Pick up two snippets that have been fixed from rust-lang#67945 (shouldn't be closed yet!)
This comment was marked as resolved.
This comment was marked as resolved.
…lcnr,estebank Fix missing diagnostic span for `impl Trait` with const generics, and add various tests for `min_const_generics` and `const_generics` Closes rust-lang#61410. Adds `min_const_generics` tests for: - rust-lang#73727 - rust-lang#72293 - rust-lang#67375 - rust-lang#75153 - rust-lang#71922 - rust-lang#69913 - rust-lang#67945 - rust-lang#69239 Adds `const_generics` tests for: - rust-lang#67375 - rust-lang#75153 - rust-lang#71922 - rust-lang#69913 - rust-lang#67945 - rust-lang#69239 (I only added separate `min_const_generics` and `const_generics` tests if they were handled differently by the two features.) We need to figure out how to deduplicate when `const_generics` is stabilised, but we can discuss that later. For now, we should be checking neither feature breaks, so require regression tests for both. I've given them identical names when I've added both, which should make it easier to spot them later. r? @lcnr
Triage: All the snippets including the original are no longer ICE with the latest nightly: https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=fc90d68f3fd2b8958e7365870eee6202 |
…askrgr Rollup of 10 pull requests Successful merges: - rust-lang#97709 (Normalize consts' tys when relating with `adt_const_params`) - rust-lang#97875 (Remove the `infer_static_outlives_requirements` feature) - rust-lang#97960 (interpret: unify offset_from check with offset check) - rust-lang#97999 (Make `type_changing_struct_update` no longer an incomplete feature) - rust-lang#98043 (Remove unnecessary `to_string` and `String::new`) - rust-lang#98044 ([issues:97981] del unrelated comment) - rust-lang#98049 (Document an edge case of `str::split_once`) - rust-lang#98050 (Add some more regression tests for rust-lang#67945) - rust-lang#98054 (Fix error message for `download-ci-llvm`) - rust-lang#98057 (Update miri) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
The following ICE's on nightly and beta:
Backtrace:
The text was updated successfully, but these errors were encountered: