Update error code page
This commit is contained in:
parent
9beb6f81e4
commit
b5693a39d9
1 changed files with 4 additions and 12 deletions
|
@ -3,12 +3,8 @@ An unstable feature in `const` contexts was used.
|
||||||
Erroneous code example:
|
Erroneous code example:
|
||||||
|
|
||||||
```compile_fail,E0723
|
```compile_fail,E0723
|
||||||
trait T {}
|
const fn foo<T: Copy>(_: T) { // error!
|
||||||
|
// ...
|
||||||
impl T for () {}
|
|
||||||
|
|
||||||
const fn foo() -> impl T { // error: `impl Trait` in const fn is unstable
|
|
||||||
()
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -18,11 +14,7 @@ feature flag:
|
||||||
```
|
```
|
||||||
#![feature(const_fn)]
|
#![feature(const_fn)]
|
||||||
|
|
||||||
trait T {}
|
const fn foo<T: Copy>(_: T) { // ok!
|
||||||
|
// ...
|
||||||
impl T for () {}
|
|
||||||
|
|
||||||
const fn foo() -> impl T {
|
|
||||||
()
|
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue