Skip to content

Internal compiler error #15260

Closed
Closed
@fmendez

Description

@fmendez

I was playing around with some simple code and after making a mistake (typo) and trying to compile it I a got some "semi-ambiguous" error message. The first part helped me to identify the issue while the second part did confused me a bit.

struct Person {
  age: uint,
  phone:uint,
}

fn main(){
  let fernando = Person {age:29, phone:456};

  let age = {
    let Person {age: ref my_age, age: _} = fernando;
    my_age
  }; 

  println!("{}",age);
}
test.rs:15:9: 15:41 error: field `age` bound twice in pattern
test.rs:15     let Person {age: ref my_age, age: _} = fernando;
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
test.rs:15:9: 15:41 error: pattern does not mention field `phone`
test.rs:15     let Person {age: ref my_age, age: _} = fernando;
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: internal compiler error: no type for node 32: pat _ (id=32) in fcx 0x113daad28
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 'Box<Any>', /Users/rustbuild/src/rust-buildbot/slave/nightly-mac/build/src/libsyntax/diagnostic.rs:163

I ran this thru several folks at the rust IRC and they suggested the report.

Metadata

Metadata

Assignees

No one assigned

    Labels

    I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions