Closed
Description
The following code results in ICE:
fn main() {
let a = "".x[0];
}
main.rs:2:11: 2:15 error: attempted access of field `x` on type `&'static str`, but no field with that name was found
main.rs:2 let a = "".x[0];
^~~~
error: internal compiler error: no type for node 14: expr 0 (id=14) in fcx 0x47ec378
note: the compiler unexpectedly panicked. 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
thread 'rustc' panicked at 'Box<Any>', C:\bot\slave\nightly-dist-rustc-win-64\build\src\libsyntax\diagnostic.rs:182
>rustc --version
rustc 1.0.0-nightly (44a287e6e 2015-01-08 17:03:40 -0800)
The error happens whenever 'x' is a unknown field or method; using a slice instead of an index also results in ICE.