rust/tests/ui/marker_trait_attr/override-item-on-marker-trait.rs
2023-01-11 09:32:08 +00:00

24 lines
430 B
Rust

#![feature(marker_trait_attr)]
#[marker]
trait Marker {
const N: usize = 0;
fn do_something() {}
}
struct OverrideConst;
impl Marker for OverrideConst {
//~^ ERROR impls for marker traits cannot contain items
const N: usize = 1;
}
struct OverrideFn;
impl Marker for OverrideFn {
//~^ ERROR impls for marker traits cannot contain items
fn do_something() {
println!("Hello world!");
}
}
fn main() {}