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

brson opened this Issue Jan 10, 2017 · 5 comments


None yet

4 participants

brson commented Jan 10, 2017 edited 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/ unreachable for-loop pattern
   --> src/
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:

thread 'rustc' panicked at 'Box<Any>', /buildslave/rust-buildbot/slave/nightly-dist-rustc-linux/build/src/librustc_errors/
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 commented Jan 11, 2017 edited

Reduced test case:

enum Void {}

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

Thanks @notriddle !


#38069 is probably related to this.


triage: P-high

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