]> git.proxmox.com Git - rustc.git/blob - src/librustc_error_codes/error_codes/E0379.md
New upstream version 1.47.0+dfsg1
[rustc.git] / src / librustc_error_codes / error_codes / E0379.md
1 A trait method was declared const.
2
3 Erroneous code example:
4
5 ```compile_fail,E0379
6 #![feature(const_fn)]
7
8 trait Foo {
9 const fn bar() -> u32; // error!
10 }
11 ```
12
13 Trait methods cannot be declared `const` by design. For more information, see
14 [RFC 911].
15
16 [RFC 911]: https://github.com/rust-lang/rfcs/pull/911