File: opaque_types.stderr

package info (click to toggle)
rustc-web 1.85.0%2Bdfsg3-1~deb12u3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 1,759,988 kB
  • sloc: xml: 158,127; python: 35,830; javascript: 19,497; cpp: 19,002; sh: 17,245; ansic: 13,127; asm: 4,376; makefile: 1,056; lisp: 29; perl: 29; ruby: 19; sql: 11
file content (136 lines) | stat: -rw-r--r-- 4,317 bytes parent folder | download | duplicates (6)
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
error: `Foo` is forbidden as the type of a const generic parameter
  --> $DIR/opaque_types.rs:7:17
   |
LL | fn foo<const C: Foo>() {}
   |                 ^^^
   |
   = note: the only supported types are integers, `bool`, and `char`

error: item does not constrain `Foo::{opaque#0}`, but has it in its signature
  --> $DIR/opaque_types.rs:7:4
   |
LL | fn foo<const C: Foo>() {}
   |    ^^^
   |
   = note: consider moving the opaque type's declaration and defining uses into a separate module
note: this opaque type is in the signature
  --> $DIR/opaque_types.rs:3:12
   |
LL | type Foo = impl Sized;
   |            ^^^^^^^^^^

error[E0308]: mismatched types
  --> $DIR/opaque_types.rs:12:11
   |
LL | type Foo = impl Sized;
   |            ---------- the expected opaque type
...
LL |     foo::<42>();
   |           ^^ expected opaque type, found integer
   |
   = note: expected opaque type `Foo`
                     found type `{integer}`

error[E0391]: cycle detected when computing type of `Foo::{opaque#0}`
  --> $DIR/opaque_types.rs:3:12
   |
LL | type Foo = impl Sized;
   |            ^^^^^^^^^^
   |
note: ...which requires computing type of opaque `Foo::{opaque#0}`...
  --> $DIR/opaque_types.rs:3:12
   |
LL | type Foo = impl Sized;
   |            ^^^^^^^^^^
note: ...which requires type-checking `main`...
  --> $DIR/opaque_types.rs:11:1
   |
LL | fn main() {
   | ^^^^^^^^^
note: ...which requires evaluating type-level constant...
  --> $DIR/opaque_types.rs:12:11
   |
LL |     foo::<42>();
   |           ^^
note: ...which requires const-evaluating + checking `main::{constant#0}`...
  --> $DIR/opaque_types.rs:12:11
   |
LL |     foo::<42>();
   |           ^^
note: ...which requires caching mir of `main::{constant#0}` for CTFE...
  --> $DIR/opaque_types.rs:12:11
   |
LL |     foo::<42>();
   |           ^^
note: ...which requires elaborating drops for `main::{constant#0}`...
  --> $DIR/opaque_types.rs:12:11
   |
LL |     foo::<42>();
   |           ^^
   = note: ...which requires normalizing `Foo`...
   = note: ...which again requires computing type of `Foo::{opaque#0}`, completing the cycle
note: cycle used when checking that `Foo::{opaque#0}` is well-formed
  --> $DIR/opaque_types.rs:3:12
   |
LL | type Foo = impl Sized;
   |            ^^^^^^^^^^
   = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information

error[E0391]: cycle detected when computing type of opaque `Foo::{opaque#0}`
  --> $DIR/opaque_types.rs:3:12
   |
LL | type Foo = impl Sized;
   |            ^^^^^^^^^^
   |
note: ...which requires type-checking `main`...
  --> $DIR/opaque_types.rs:11:1
   |
LL | fn main() {
   | ^^^^^^^^^
note: ...which requires evaluating type-level constant...
  --> $DIR/opaque_types.rs:12:11
   |
LL |     foo::<42>();
   |           ^^
note: ...which requires const-evaluating + checking `main::{constant#0}`...
  --> $DIR/opaque_types.rs:12:11
   |
LL |     foo::<42>();
   |           ^^
note: ...which requires caching mir of `main::{constant#0}` for CTFE...
  --> $DIR/opaque_types.rs:12:11
   |
LL |     foo::<42>();
   |           ^^
note: ...which requires elaborating drops for `main::{constant#0}`...
  --> $DIR/opaque_types.rs:12:11
   |
LL |     foo::<42>();
   |           ^^
note: ...which requires borrow-checking `main::{constant#0}`...
  --> $DIR/opaque_types.rs:12:11
   |
LL |     foo::<42>();
   |           ^^
note: ...which requires promoting constants in MIR for `main::{constant#0}`...
  --> $DIR/opaque_types.rs:12:11
   |
LL |     foo::<42>();
   |           ^^
note: ...which requires const checking `main::{constant#0}`...
  --> $DIR/opaque_types.rs:12:11
   |
LL |     foo::<42>();
   |           ^^
   = note: ...which again requires computing type of opaque `Foo::{opaque#0}`, completing the cycle
note: cycle used when computing type of `Foo::{opaque#0}`
  --> $DIR/opaque_types.rs:3:12
   |
LL | type Foo = impl Sized;
   |            ^^^^^^^^^^
   = note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information

error: aborting due to 5 previous errors

Some errors have detailed explanations: E0308, E0391.
For more information about an error, try `rustc --explain E0308`.