]> git.lizzy.rs Git - rust.git/blob - compiler/rustc_error_codes/src/error_codes/E0723.md
Rollup merge of #81210 - ssomers:btree_fix_node_size_test, r=Mark-Simulacrum
[rust.git] / compiler / rustc_error_codes / src / error_codes / E0723.md
1 An unstable feature in `const` contexts was used.
2
3 Erroneous code example:
4
5 ```compile_fail,E0723
6 const fn foo<T: Copy>(_: T) { // error!
7    // ...
8 }
9 ```
10
11 To enable this feature on a nightly version of rustc, add the `const_fn`
12 feature flag:
13
14 ```
15 #![feature(const_fn)]
16
17 const fn foo<T: Copy>(_: T) { // ok!
18    // ...
19 }
20 ```