Skip to content

ICE with phantom types using default type parameters #11964

@omasanori

Description

@omasanori

Code:

#[feature(default_type_params)];

struct Foo<T> { dummy: T }

struct Bar<T, U = Foo<T>> { dummy: T }

fn main() {
    let _a: Bar<int> = Bar { dummy: 1 };
}

Output:

error: internal compiler error: unexpected failure
This message reflects a bug in the Rust compiler. 
We would appreciate a bug report: http://static.rust-lang.org/doc/master/complement-bugreport.html
note: the compiler hit an unexpected failure path. this is a bug
task 'rustc' failed at 'assertion failed: !ty::type_has_params(t)', /var/tmp/portage/dev-lang/rust-9999/work/rust-9999/src/librustc/middle/trans/common.rs:826

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