-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Closed
Labels
A-associated-itemsArea: Associated items (types, constants & functions)Area: Associated items (types, constants & functions)A-trait-systemArea: Trait systemArea: Trait systemA-type-systemArea: Type systemArea: Type systemT-langRelevant to the language teamRelevant to the language team
Description
The following code compiles:
#![feature(associated_consts)]
trait Foo {
const FOO: u32;
}
impl Foo for () {
const FOO: u32 = 1;
}
fn main() {
let _: &Foo = &();
}
Furthermore, adding the line <Foo>::FOO;
to main
causes an ICE:
error: internal compiler error: unexpected panic
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: run with `RUST_BACKTRACE=1` for a backtrace
thread 'rustc' panicked at 'assertion failed: match trait_items[method_offset_in_trait] {
ty::MethodTraitItem(_) => true,
_ => false,
}', ../src/librustc/middle/traits/util.rs:439
stepancheg
Metadata
Metadata
Assignees
Labels
A-associated-itemsArea: Associated items (types, constants & functions)Area: Associated items (types, constants & functions)A-trait-systemArea: Trait systemArea: Trait systemA-type-systemArea: Type systemArea: Type systemT-langRelevant to the language teamRelevant to the language team