You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: tests/ui/const-generics/not_wf_param_in_rpitit.stderr
+26-85Lines changed: 26 additions & 85 deletions
Original file line number
Diff line number
Diff line change
@@ -4,110 +4,51 @@ error[E0425]: cannot find value `bar` in this scope
4
4
LL | trait Trait<const N: Trait = bar> {
5
5
| ^^^ not found in this scope
6
6
7
-
error[E0391]: cycle detected when computing type of `Trait::N`
8
-
--> $DIR/not_wf_param_in_rpitit.rs:3:22
7
+
error[E0391]: cycle detected when computing predicates of `Trait`
8
+
--> $DIR/not_wf_param_in_rpitit.rs:3:1
9
9
|
10
10
LL | trait Trait<const N: Trait = bar> {
11
-
| ^^^^^
11
+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
12
12
|
13
-
= note: ...which immediately requires computing type of `Trait::N` again
14
-
note: cycle used when computing explicit predicates of trait `Trait`
13
+
note: ...which requires computing predicates of `Trait`...
15
14
--> $DIR/not_wf_param_in_rpitit.rs:3:1
16
15
|
17
16
LL | trait Trait<const N: Trait = bar> {
18
17
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
19
-
= 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
20
-
21
-
error[E0038]: the trait `Trait` cannot be made into an object
22
-
--> $DIR/not_wf_param_in_rpitit.rs:3:22
18
+
note: ...which requires computing explicit predicates of `Trait`...
19
+
--> $DIR/not_wf_param_in_rpitit.rs:3:1
23
20
|
24
21
LL | trait Trait<const N: Trait = bar> {
25
-
| ^^^^^ `Trait` cannot be made into an object
26
-
|
27
-
note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
28
-
--> $DIR/not_wf_param_in_rpitit.rs:11:14
22
+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
23
+
note: ...which requires computing explicit predicates of trait `Trait`...
24
+
--> $DIR/not_wf_param_in_rpitit.rs:3:1
29
25
|
30
26
LL | trait Trait<const N: Trait = bar> {
31
-
| ----- this trait cannot be made into an object...
32
-
...
33
-
LL | async fn a() {}
34
-
| ^ ...because associated function `a` has no `self` parameter
35
-
help: consider turning `a` into a method by giving it a `&self` argument
36
-
|
37
-
LL | async fn a(&self) {}
38
-
| +++++
39
-
help: alternatively, consider constraining `a` so it does not apply to trait objects
40
-
|
41
-
LL | async fn a() where Self: Sized {}
42
-
| +++++++++++++++++
43
-
44
-
error[E0038]: the trait `Trait` cannot be made into an object
27
+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
28
+
note: ...which requires computing type of `Trait::N`...
45
29
--> $DIR/not_wf_param_in_rpitit.rs:3:13
46
30
|
47
31
LL | trait Trait<const N: Trait = bar> {
48
-
| ^^^^^^^^^^^^^^^^^^^^ `Trait` cannot be made into an object
49
-
|
50
-
note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
51
-
--> $DIR/not_wf_param_in_rpitit.rs:11:14
52
-
|
53
-
LL | trait Trait<const N: Trait = bar> {
54
-
| ----- this trait cannot be made into an object...
55
-
...
56
-
LL | async fn a() {}
57
-
| ^ ...because associated function `a` has no `self` parameter
58
-
help: consider turning `a` into a method by giving it a `&self` argument
59
-
|
60
-
LL | async fn a(&self) {}
61
-
| +++++
62
-
help: alternatively, consider constraining `a` so it does not apply to trait objects
63
-
|
64
-
LL | async fn a() where Self: Sized {}
65
-
| +++++++++++++++++
66
-
67
-
error: `(dyn Trait<{const error}> + 'static)` is forbidden as the type of a const generic parameter
68
-
--> $DIR/not_wf_param_in_rpitit.rs:3:22
69
-
|
70
-
LL | trait Trait<const N: Trait = bar> {
71
-
| ^^^^^
72
-
|
73
-
= note: the only supported types are integers, `bool` and `char`
74
-
75
-
error[E0038]: the trait `Trait` cannot be made into an object
76
-
--> $DIR/not_wf_param_in_rpitit.rs:3:13
32
+
| ^^^^^^^^^^^^^^^^^^^^
33
+
note: ...which requires determining object safety of trait `Trait`...
34
+
--> $DIR/not_wf_param_in_rpitit.rs:3:1
77
35
|
78
36
LL | trait Trait<const N: Trait = bar> {
79
-
| ^^^^^^^^^^^^^^^^^^^^ `Trait` cannot be made into an object
80
-
|
81
-
note: for a trait to be "object safe" it needs to allow building a vtable to allow the call to be resolvable dynamically; for more information visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
82
-
--> $DIR/not_wf_param_in_rpitit.rs:11:14
37
+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
38
+
note: ...which requires check whether the item has a `where Self: Sized` bound...
39
+
--> $DIR/not_wf_param_in_rpitit.rs:6:5
83
40
|
84
-
LL | trait Trait<const N: Trait = bar> {
85
-
| ----- this trait cannot be made into an object...
86
-
...
87
41
LL | async fn a() {}
88
-
| ^ ...because associated function `a` has no `self` parameter
89
-
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
90
-
help: consider turning `a` into a method by giving it a `&self` argument
91
-
|
92
-
LL | async fn a(&self) {}
93
-
| +++++
94
-
help: alternatively, consider constraining `a` so it does not apply to trait objects
95
-
|
96
-
LL | async fn a() where Self: Sized {}
97
-
| +++++++++++++++++
98
-
99
-
error[E0782]: trait objects must include the `dyn` keyword
100
-
--> $DIR/not_wf_param_in_rpitit.rs:3:22
42
+
| ^^^^^^^^^^^^
43
+
= note: ...which again requires computing predicates of `Trait`, completing the cycle
44
+
note: cycle used when checking that `Trait` is well-formed
45
+
--> $DIR/not_wf_param_in_rpitit.rs:3:1
101
46
|
102
47
LL | trait Trait<const N: Trait = bar> {
103
-
| ^^^^^
104
-
|
105
-
help: add `dyn` keyword before this trait
106
-
|
107
-
LL | trait Trait<const N: dyn Trait = bar> {
108
-
| +++
48
+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
49
+
= 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
109
50
110
-
error: aborting due to 7 previous errors
51
+
error: aborting due to 2 previous errors
111
52
112
-
Some errors have detailed explanations: E0038, E0391, E0425, E0782.
113
-
For more information about an error, try `rustc --explain E0038`.
53
+
Some errors have detailed explanations: E0391, E0425.
54
+
For more information about an error, try `rustc --explain E0391`.
0 commit comments