Skip to content

ICE using associated types: "unbound path" #17956

@awelkie

Description

@awelkie

The following code fails with an ICE:

#![feature(associated_types)]
trait ATrait<T> {
    type Output;
    fn return_output() -> <Self as ATrait<T>>::Output;
}

The error:

associated.rs:4:43: 4:44 error: internal compiler error: unbound path path(T)
associated.rs:4     fn return_output() -> <Self as ATrait<T>>::Output;
                                                          ^
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>', /home/rustbuild/src/rust-buildbot/slave/nightly-linux/build/src/libsyntax/diagnostic.rs:113

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