forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconst-fn-cycle.stderr
More file actions
39 lines (37 loc) · 2.22 KB
/
const-fn-cycle.stderr
File metadata and controls
39 lines (37 loc) · 2.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
error[E0391]: cycle detected when computing type of `<impl at $DIR/const-fn-cycle.rs:12:1: 12:21>::many::{opaque#0}`
--> $DIR/const-fn-cycle.rs:20:47
|
LL | pub const fn many<'s>(&'s self) -> Parser<impl for<'a> Fn(&'a str) -> Vec<T> + 's> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: ...which requires borrow-checking `<impl at $DIR/const-fn-cycle.rs:12:1: 12:21>::many`...
--> $DIR/const-fn-cycle.rs:20:5
|
LL | pub const fn many<'s>(&'s self) -> Parser<impl for<'a> Fn(&'a str) -> Vec<T> + 's> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: ...which requires promoting constants in MIR for `<impl at $DIR/const-fn-cycle.rs:12:1: 12:21>::many`...
--> $DIR/const-fn-cycle.rs:20:5
|
LL | pub const fn many<'s>(&'s self) -> Parser<impl for<'a> Fn(&'a str) -> Vec<T> + 's> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: ...which requires const checking `<impl at $DIR/const-fn-cycle.rs:12:1: 12:21>::many`...
--> $DIR/const-fn-cycle.rs:20:5
|
LL | pub const fn many<'s>(&'s self) -> Parser<impl for<'a> Fn(&'a str) -> Vec<T> + 's> {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
= note: ...which requires computing whether `Parser<<impl at $DIR/const-fn-cycle.rs:12:1: 12:21>::many::{opaque#0}>` is freeze...
= note: ...which requires evaluating trait selection obligation `Parser<<impl at $DIR/const-fn-cycle.rs:12:1: 12:21>::many::{opaque#0}>: core::marker::Freeze`...
= note: ...which again requires computing type of `<impl at $DIR/const-fn-cycle.rs:12:1: 12:21>::many::{opaque#0}`, completing the cycle
note: cycle used when checking item types in top-level module
--> $DIR/const-fn-cycle.rs:1:1
|
LL | / /// Discovered in https://github.com/rust-lang/rust/issues/112602.
LL | | /// This caused a cycle error, which made no sense.
LL | | /// Removing the `const` part of the `many` function would make the
LL | | /// test pass again.
... |
LL | | println!("Hello, world!");
LL | | }
| |_^
error: aborting due to previous error
For more information about this error, try `rustc --explain E0391`.