Skip to content

Compiler crashes when using feature "associated_type_defaults" #37051

Closed
@lilianmoraru

Description

@lilianmoraru

rustc: rustc 1.14.0-nightly (6e8f92f11 2016-10-07)
cargo: cargo 0.13.0-nightly (6534bdd 2016-10-07)

Short code example to reproduce the issue:

#![feature(associated_type_defaults)]

trait State: Sized {
    type NextState: State = StateMachineEnded;
    fn execute(self) -> Option<Self::NextState>;
}

struct StateMachineEnded;

impl State for StateMachineEnded {
    fn execute(self) -> Option<Self::NextState> {
        None
    }
}

Adding type NextState = StateMachineEnded; to the implementation - will compile.

RUST_LOG=trace RUST_BACKTRACE=1 cargo build log: https://gist.github.com/lilianmoraru/69701f72b626f9872661952190066b37

Metadata

Metadata

Assignees

No one assigned

    Labels

    E-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.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