]> git.proxmox.com Git - rustc.git/blame - src/librustc_error_codes/error_codes/E0723.md
New upstream version 1.47.0+dfsg1
[rustc.git] / src / librustc_error_codes / error_codes / E0723.md
CommitLineData
3dfed10e 1An unstable feature in `const` contexts was used.
60c5eb7d
XL
2
3Erroneous code example:
4
5```compile_fail,E0723
6trait T {}
7
8impl T for () {}
9
10const fn foo() -> impl T { // error: `impl Trait` in const fn is unstable
11 ()
12}
13```
14
15To enable this feature on a nightly version of rustc, add the `const_fn`
16feature flag:
17
18```
19#![feature(const_fn)]
20
21trait T {}
22
23impl T for () {}
24
25const fn foo() -> impl T {
26 ()
27}
28```