-
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 "Tried to access element 1 of array/slice with length 0" (librustc_mir) / const_eval / collect_and_partition_mono_items #53275
Comments
The error reproduces on Travis: https://travis-ci.org/ralfbiedert/ffsvm-rust/builds/414946306 |
Minimal changes needed to trigger / prevent ICE: ralfbiedert/ffsvm@344c31f (no ICE) |
It would be great if someone could test this on a recent rustc and if it still fails, try to minimize it |
I had to update a few files to make it "compile" again, but I still get an ICE with a recent
|
Awesome! thanks for the quick work. |
@ralfbiedert Do you think you could reduce this further? |
I just tried to reproduce this once more with
This pretty much seems to "prevent" how I could previously ICE it, enabling or disabling macro invocations with an empty array that then got accessed: // ENABLING THIS LINE TRIGGERS IT:
test_model!(m_csvm_linear, "m_csvm_linear.libsvm", false, [0, 7], []); Seems like this got fixed. On a side note, I'm positively surprised it detects this will panic at runtime, although one could make the argument that maybe I wanted that macro expansion to panic inside a (Update) Hm, strangely enough, the error generation is only triggered when running |
Cool; ideally, if we could create a minimal example that we could add as a regression test that would be great, and if not, then I guess we'll close the issue as it no longer ICEs. |
Alright, here is the MVP that would do it: // src/lib.rs
struct S(u8);
pub fn ice() {
S([][0]);
} When I run this with |
Thanks, cc @JohnTitor |
Add test for issue rust-lang#53275 Fixes rust-lang#53275
Rollup of 9 pull requests Successful merges: - rust-lang#68700 (Add Wake trait for safe construction of Wakers.) - rust-lang#69494 (Stabilize --crate-version option in rustdoc) - rust-lang#70080 (rustc_mir: remove extra space when pretty-printing MIR.) - rust-lang#70195 (Add test for issue rust-lang#53275) - rust-lang#70199 (Revised span-to-lines conversion to produce an empty vec on DUMMY_SP.) - rust-lang#70299 (add err_machine_stop macro) - rust-lang#70300 (Reword unused variable warning) - rust-lang#70315 (Rename remaining occurences of Void to Opaque.) - rust-lang#70318 (Split long derive lists into two derive attributes.) Failed merges: r? @ghost
When compiling
https://github.com/ralfbiedert/ffsvm-rust/tree/ICE (7ad7b9d78af0984bb909d07107ddcdfc2d3d6b67)
with the command
cargo test --verbose
I receive the following ICE:rustup update
reports:The text was updated successfully, but these errors were encountered: