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: unexpected failure path, comparing in librustc/middle/trans/datum.rs #17336

Closed
DanielKeep opened this issue Sep 17, 2014 · 5 comments
Closed
Labels
A-DSTs Area: Dynamically-sized types (DSTs) I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@DanielKeep
Copy link
Contributor

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 &strs were identical as a sanity check.

@huonw huonw added I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ A-DSTs Area: Dynamically-sized types (DSTs) labels Sep 17, 2014
@frewsxcv
Copy link
Member

Can confirm this still results in an ICE.

rustc 1.0.0-nightly (522d09dfe 2015-02-19) (built 2015-02-19)
binary: rustc
commit-hash: 522d09dfecbeca1595f25ac58c6d0178bbd21d7d
commit-date: 2015-02-19
build-date: 2015-02-19
host: x86_64-apple-darwin
release: 1.0.0-nightly

@tamird
Copy link
Contributor

tamird commented Apr 22, 2015

Triage: still ICEs.

@arielb1
Copy link
Contributor

arielb1 commented Jun 25, 2015

cc rust-lang/rfcs#1135

@pmarcelll
Copy link
Contributor

#28270 fixed this.

@frewsxcv
Copy link
Member

I'll add a regression test for this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-DSTs Area: Dynamically-sized types (DSTs) I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

No branches or pull requests

6 participants