Closed
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