Skip to content
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 in empty-0.0.4, Rust 1.16, unreachable for-loop pattern #38969

Closed
brson opened this Issue Jan 10, 2017 · 7 comments

Comments

Projects
None yet
4 participants
@brson
Copy link
Contributor

brson commented Jan 10, 2017

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 ICE in empty-0.0.4, unreachable for-loop pattern 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

This comment has been minimized.

Copy link
Contributor

notriddle commented Jan 11, 2017

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

enum Void {}

fn main() {
    let x: [Void; 0] = [];
    for _ in &x {}
}
@brson

This comment has been minimized.

Copy link
Contributor Author

brson commented Jan 11, 2017

Thanks @notriddle !

@notriddle

This comment has been minimized.

Copy link
Contributor

notriddle commented Jan 12, 2017

#38069 is probably related to this.

@nikomatsakis

This comment has been minimized.

Copy link
Contributor

nikomatsakis commented Jan 12, 2017

@nikomatsakis

This comment has been minimized.

Copy link
Contributor

nikomatsakis commented Jan 12, 2017

triage: P-high

@nikomatsakis

This comment has been minimized.

Copy link
Contributor

nikomatsakis commented Jan 26, 2017

Fixed by #39127 I think?

@brson brson closed this Jan 26, 2017

@brson

This comment has been minimized.

Copy link
Contributor Author

brson commented Jan 26, 2017

Thanks @canndrew!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.