]> git.lizzy.rs Git - rust.git/blob - compiler/rustc_error_codes/src/error_codes/E0714.md
Rollup merge of #92310 - ehuss:rustdoc-ice, r=estebank
[rust.git] / compiler / rustc_error_codes / src / error_codes / E0714.md
1 A `#[marker]` trait contained an associated item.
2
3 Erroneous code example:
4
5 ```compile_fail,E0714
6 #![feature(marker_trait_attr)]
7 #![feature(associated_type_defaults)]
8
9 #[marker]
10 trait MarkerConst {
11     const N: usize; // error!
12 }
13
14 fn main() {}
15 ```
16
17 The items of marker traits cannot be overridden, so there's no need to have them
18 when they cannot be changed per-type anyway.  If you wanted them for ergonomic
19 reasons, consider making an extension trait instead.