Skip to content

rustc: internal compiler error: Cannot encode inference variable types #11677

@reima

Description

@reima

Source:

trait X<T> {}                           

struct S<T> {f: Box<X<T>>, g: Box<X<T>>}

struct F;                               
impl X<int> for F {}                    

fn main() {                             
  S {f: box F, g: box F};               
}                                       

Output:

$ rustc main.rs
error: internal compiler error: Cannot encode inference variable types
This message reflects a bug in the Rust compiler. 
We would appreciate a bug report: https://github.com/mozilla/rust/wiki/HOWTO-submit-a-Rust-bug-report
task 'rustc' failed at 'explicit failure', /build/buildd/rust-0.9-0.9/src/libsyntax/diagnostic.rs:75
task '<main>' failed at 'explicit failure', /build/buildd/rust-0.9-0.9/src/librustc/lib.rs:453

rustc -v

rustc 0.9
host: x86_64-unknown-linux-gnu

uname -a

Linux marvin 3.11.0-15-generic #23-Ubuntu SMP Mon Dec 9 18:17:04 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

Tried to get a backtrace with gdb, but the binaries I'm using (https://launchpad.net/~hansjorg/+archive/rust) don't seem to have any debugging symbols.

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