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
| ^^^^^^^^^^ ...because method `baz` references an `impl Trait` type in its return type
14
14
= help: consider moving `baz` to another trait
15
15
16
+
error[E0038]: the trait `Foo` cannot be made into an object
17
+
--> $DIR/object-safety.rs:20:15
18
+
|
19
+
LL | let s = i.baz();
20
+
| ^^^ `Foo` cannot be made into an object
21
+
|
22
+
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>
23
+
--> $DIR/object-safety.rs:7:22
24
+
|
25
+
LL | trait Foo {
26
+
| --- this trait cannot be made into an object...
27
+
LL | fn baz(&self) -> impl Debug;
28
+
| ^^^^^^^^^^ ...because method `baz` references an `impl Trait` type in its return type
29
+
= help: consider moving `baz` to another trait
30
+
16
31
error[E0038]: the trait `Foo` cannot be made into an object
0 commit comments