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
error[E0038]: the trait `FromResidual` cannot be made into an object
2
+
--> $DIR/issue-103626.rs:10:17
3
+
|
4
+
LL | let b: &dyn FromResidual = &();
5
+
| ^^^^^^^^^^^^
6
+
|
7
+
= note: it cannot use `Self` as a type parameter in a supertrait or `where`-clause
8
+
9
+
error[E0038]: the trait `FromResidual` cannot be made into an object
10
+
--> $DIR/issue-103626.rs:10:12
11
+
|
12
+
LL | let b: &dyn FromResidual = &();
13
+
| ^^^^^^^^^^^^^^^^^ `FromResidual` cannot be made into an object
14
+
|
15
+
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>
16
+
--> $DIR/issue-103626.rs:2:8
17
+
|
18
+
LL | trait FromResidual<R = <Self as Try>::Residual> {
19
+
| ------------ this trait cannot be made into an object...
20
+
LL | fn from_residual(residual: R) -> Self;
21
+
| ^^^^^^^^^^^^^ ...because associated function `from_residual` has no `self` parameter
22
+
help: consider turning `from_residual` into a method by giving it a `&self` argument
0 commit comments