Skip to content

ICE: resolve_trait_associated_const: unexpected vtable type #43483

Closed
@RalfJung

Description

@RalfJung
trait VecN {
    const DIM: usize;
}
trait Mat {
    type Row: VecN;
}

fn m<M: Mat>() {
    let x = M::Row::DIM;
}
fn main() {
}

(Playpen) fails on current nightly with

   Compiling playground v0.0.1 (file:///playground)
error: internal compiler error: /checkout/src/librustc_const_eval/eval.rs:552: resolve_trait_associated_const: unexpected vtable type

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/blob/master/CONTRIBUTING.md#bug-reports

note: rustc 1.20.0-nightly (afe145d22 2017-07-23) running on x86_64-unknown-linux-gnu

thread 'rustc' panicked at 'Box<Any>', /checkout/src/librustc_errors/lib.rs:490:8
note: Run with `RUST_BACKTRACE=1` for a backtrace.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-const-evalArea: Constant evaluation, covers all const contexts (static, const fn, ...)C-bugCategory: This is a bug.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