Closed
Description
Happens on WIndows 7 x64 with latest Rust 32-bit nightly.
rustc -v verbose
:
rustc 0.12.0-pre-nightly (63eaba24d 2014-09-15 21:56:00 +0000)
binary: rustc
commit-hash: 63eaba24d6a7f93061d63337ea1f7083ca892787
commit-date: 2014-09-15 21:56:00 +0000
host: i686-w64-mingw32
release: 0.12.0-pre-nightly
(On a side note, is there any way to work out what the latest released nightly version is?)
test-ice.rs
:
#[allow(dead_code)]
fn check(a: &str) {
let x = a as *const str;
x == x;
}
fn main() {
}
Compiling with rustc test-ice.rs
produces:
error: internal compiler error: unexpected failure
note: the compiler hit an unexpected failure path. this is a bug.
note: we would appreciate a bug report: http://doc.rust-lang.org/complement-bugreport.html
note: run with `RUST_BACKTRACE=1` for a backtrace
task 'rustc' failed at 'assertion failed: self.appropriate_rvalue_mode(bcx.ccx()) == ByValue', C:\bot\slave\nightly-win32\build\src\librustc\middle\trans\datum.rs:651
stack backtrace:
1: 0x8ce8ae
2: 0x62907a4c
3: 0x6fcc51ae
4: 0x700ae66f
5: 0x700d3ea2
6: 0x700c93a5
7: 0x70085c94
8: 0x70084ffe
9: 0x7008482e
10: 0x70085e38
11: 0x7013635b
12: 0x7007425e
13: 0x7006fe4c
14: 0x70140d38
15: 0x70555cf9
16: 0x7054f548
17: 0x705f597a
18: 0x705f38dd
19: 0x6fcf8bde
20: 0x6fcf8aef
21: 0x6aeeb41c
22: 0x62907375
23: 0x62905506
24: 0x6aeeb27a
25: 0x62906fc2
26: 0x779c9f72
#[allow(dead_code)]
is there to suppress the warning, main
can be removed if you compile the rest as a library. Also works if you substitute the expression for x
directly and if you pass two &str
arguments (the original use case).
The original intent was to tell if two &str
s were identical as a sanity check.