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
= 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
20
21
-
error[E0038]: the trait `Trait` cannot be made into an object
22
-
--> $DIR/not_wf_param_in_rpitit.rs:3:22
23
-
|
24
-
LL | trait Trait<const N: dyn Trait = bar> {
25
-
| ^^^^^^^^^ `Trait` cannot be made into an object
26
-
|
27
-
note: for a trait to be "dyn-compatible" 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:9:14
29
-
|
30
-
LL | trait Trait<const N: dyn 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
45
-
--> $DIR/not_wf_param_in_rpitit.rs:3:13
46
-
|
47
-
LL | trait Trait<const N: dyn Trait = bar> {
48
-
| ^^^^^^^^^^^^^^^^^^^^^^^^ `Trait` cannot be made into an object
49
-
|
50
-
note: for a trait to be "dyn-compatible" 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:9:14
52
-
|
53
-
LL | trait Trait<const N: dyn 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[E0038]: the trait `Trait` cannot be made into an object
68
-
--> $DIR/not_wf_param_in_rpitit.rs:3:13
69
-
|
70
-
LL | trait Trait<const N: dyn Trait = bar> {
71
-
| ^^^^^^^^^^^^^^^^^^^^^^^^ `Trait` cannot be made into an object
72
-
|
73
-
note: for a trait to be "dyn-compatible" 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>
74
-
--> $DIR/not_wf_param_in_rpitit.rs:9:14
75
-
|
76
-
LL | trait Trait<const N: dyn Trait = bar> {
77
-
| ----- this trait cannot be made into an object...
78
-
...
79
-
LL | async fn a() {}
80
-
| ^ ...because associated function `a` has no `self` parameter
81
-
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
82
-
help: consider turning `a` into a method by giving it a `&self` argument
83
-
|
84
-
LL | async fn a(&self) {}
85
-
| +++++
86
-
help: alternatively, consider constraining `a` so it does not apply to trait objects
87
-
|
88
-
LL | async fn a() where Self: Sized {}
89
-
| +++++++++++++++++
90
-
91
-
error: aborting due to 5 previous errors
21
+
error: aborting due to 2 previous errors
92
22
93
-
Some errors have detailed explanations: E0038, E0391, E0425.
94
-
For more information about an error, try `rustc --explain E0038`.
23
+
Some errors have detailed explanations: E0391, E0425.
24
+
For more information about an error, try `rustc --explain E0391`.
= 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
19
19
20
-
error[E0038]: the trait `Trait` cannot be made into an object
21
-
--> $DIR/issue-34373.rs:7:24
22
-
|
23
-
LL | pub struct Foo<T = Box<Trait<DefaultFoo>>>;
24
-
| ^^^^^^^^^^^^^^^^^ `Trait` cannot be made into an object
25
-
|
26
-
note: for a trait to be "dyn-compatible" 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>
27
-
--> $DIR/issue-34373.rs:4:8
28
-
|
29
-
LL | trait Trait<T> {
30
-
| ----- this trait cannot be made into an object...
31
-
LL | fn foo(_: T) {}
32
-
| ^^^ ...because associated function `foo` has no `self` parameter
33
-
help: consider turning `foo` into a method by giving it a `&self` argument
34
-
|
35
-
LL | fn foo(&self, _: T) {}
36
-
| ++++++
37
-
help: alternatively, consider constraining `foo` so it does not apply to trait objects
0 commit comments