rust/src/test/ui/associated-const/associated-const-in-trait.rs

15 lines
228 B
Rust
Raw Normal View History

// #29924
#![feature(const_fn, associated_consts)]
trait Trait {
const N: usize;
}
impl Trait {
//~^ ERROR the trait `Trait` cannot be made into an object [E0038]
const fn n() -> usize { Self::N }
}
fn main() {}