|
1 |
| -error[E0277]: the trait bound `[closure@$DIR/issue-56164.rs:1:19: 1:21]: Fn<()>` is not satisfied |
| 1 | +error[E0015]: cannot call non-const closure in constant functions |
2 | 2 | --> $DIR/issue-56164.rs:1:18
|
3 | 3 | |
|
4 | 4 | LL | const fn foo() { (||{})() }
|
5 |
| - | ^^^^^^^^ expected an `Fn<()>` closure, found `[closure@$DIR/issue-56164.rs:1:19: 1:21]` |
| 5 | + | ^^^^^^^^ |
| 6 | + | |
| 7 | + = note: closures need an RFC before allowed to be called in constant functions |
| 8 | + = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants |
| 9 | + |
| 10 | +error: function pointer calls are not allowed in constant functions |
| 11 | + --> $DIR/issue-56164.rs:7:5 |
6 | 12 | |
|
7 |
| - = help: the trait `~const Fn<()>` is not implemented for closure `[closure@$DIR/issue-56164.rs:1:19: 1:21]` |
8 |
| -note: the trait `Fn<()>` is implemented for `[closure@$DIR/issue-56164.rs:1:19: 1:21]`, but that implementation is not `const` |
| 13 | +LL | input() |
| 14 | + | ^^^^^^^ |
| 15 | + |
| 16 | +error: erroneous constant used |
9 | 17 | --> $DIR/issue-56164.rs:1:18
|
10 | 18 | |
|
11 | 19 | LL | const fn foo() { (||{})() }
|
12 |
| - | ^^^^^^^^ |
13 |
| - = note: wrap the `[closure@$DIR/issue-56164.rs:1:19: 1:21]` in a closure with no arguments: `|| { /* code */ }` |
| 20 | + | ^^^^^^ referenced constant has errors |
| 21 | + | |
| 22 | + = note: `#[deny(const_err)]` on by default |
| 23 | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! |
| 24 | + = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800> |
14 | 25 |
|
15 |
| -error: aborting due to previous error |
| 26 | +error: aborting due to 3 previous errors |
| 27 | + |
| 28 | +For more information about this error, try `rustc --explain E0015`. |
| 29 | +Future incompatibility report: Future breakage diagnostic: |
| 30 | +error: erroneous constant used |
| 31 | + --> $DIR/issue-56164.rs:1:18 |
| 32 | + | |
| 33 | +LL | const fn foo() { (||{})() } |
| 34 | + | ^^^^^^ referenced constant has errors |
| 35 | + | |
| 36 | + = note: `#[deny(const_err)]` on by default |
| 37 | + = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! |
| 38 | + = note: for more information, see issue #71800 <https://github.com/rust-lang/rust/issues/71800> |
16 | 39 |
|
17 |
| -For more information about this error, try `rustc --explain E0277`. |
|
0 commit comments