]> git.lizzy.rs Git - rust.git/blob - compiler/rustc_error_codes/src/error_codes/E0379.md
Rollup merge of #92310 - ehuss:rustdoc-ice, r=estebank
[rust.git] / compiler / rustc_error_codes / src / error_codes / E0379.md
1 A trait method was declared const.
2
3 Erroneous code example:
4
5 ```compile_fail,E0379
6 trait Foo {
7     const fn bar() -> u32; // error!
8 }
9 ```
10
11 Trait methods cannot be declared `const` by design. For more information, see
12 [RFC 911].
13
14 [RFC 911]: https://github.com/rust-lang/rfcs/pull/911