ICE in empty-0.0.4, Rust 1.16, unreachable for-loop pattern #38969

Open
brson opened this Issue Jan 10, 2017 · 5 comments

Projects

None yet

4 participants

@brson
Contributor
brson commented Jan 10, 2017 edited

https://github.com/notriddle/rust-empty 434e1cd22b20b498ecbb00c0b19314617862cb2a

Not on stable/beta.

rustc 1.16.0-nightly (47c8d9fdc 2017-01-08)
binary: rustc
commit-hash: 47c8d9fdcf2e6502cf4ca7d7f059fdc1a2810afa
commit-date: 2017-01-08
host: x86_64-unknown-linux-gnu
release: 1.16.0-nightly
LLVM version: 3.9
brian@ip-10-145-43-250:~/dev/rust-empty⟫ cargo +nightly test
   Compiling void v1.0.2
   Compiling empty v0.0.4 (file:///mnt2/dev/rust-empty)
error: internal compiler error: /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/src/librustc_const_eval/check_match.rs:314: unreachable for-loop pattern
   --> src/lib.rs:191:9
    |
191 |           for i in super::List {
    |  _________^ starting here...
192 | |             void::unreachable(i);
193 | |         }
    | |_________^ ...ending here

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports

thread 'rustc' panicked at 'Box<Any>', /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/src/librustc_errors/lib.rs:382
note: Run with `RUST_BACKTRACE=1` for a backtrace.

Build failed, waiting for other jobs to finish...
error: Could not compile `empty`.

To learn more, run the command again with --verbose.

cc @notriddle

@brson brson changed the title from ICE in empty-0.0.4, unreachable for-loop pattern to ICE in empty-0.0.4, Rust 1.16, unreachable for-loop pattern Jan 10, 2017
@brson brson added the I-ICE label Jan 11, 2017
@notriddle
Contributor
notriddle commented Jan 11, 2017 edited

Reduced test case: https://play.rust-lang.org/?gist=19540e34c9fbb1e99e534bf4b9d5ecac&version=nightly

enum Void {}

fn main() {
    let x: [Void; 0] = [];
    for _ in &x {}
}
@brson
Contributor
brson commented Jan 11, 2017

Thanks @notriddle !

@notriddle
Contributor

#38069 is probably related to this.

@nikomatsakis
Contributor
@nikomatsakis
Contributor

triage: P-high

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment