mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 07:14:28 +00:00
24 lines
430 B
Rust
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() {}
|