1 error[E0038]: the trait `Trait` cannot be made into an object
2 --> $DIR/object-unsafe-trait-references-self.rs:6:12
4 LL | fn bar(x: &dyn Trait) {}
5 | ^^^^^^^^^ `Trait` cannot be made into an object
7 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>
8 --> $DIR/object-unsafe-trait-references-self.rs:2:22
11 | ----- this trait cannot be made into an object...
12 LL | fn baz(&self, _: Self) {}
13 | ^^^^ ...because method `baz` references the `Self` type in this parameter
14 LL | fn bat(&self) -> Self {}
15 | ^^^^ ...because method `bat` references the `Self` type in its return type
16 = help: consider moving `baz` to another trait
17 = help: consider moving `bat` to another trait
19 error[E0038]: the trait `Other` cannot be made into an object
20 --> $DIR/object-unsafe-trait-references-self.rs:10:12
22 LL | fn foo(x: &dyn Other) {}
23 | ^^^^^^^^^ `Other` cannot be made into an object
25 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>
26 --> $DIR/object-unsafe-trait-references-self.rs:8:14
28 LL | trait Other: Sized {}
29 | ----- ^^^^^ ...because it requires `Self: Sized`
31 | this trait cannot be made into an object...
33 error: aborting due to 2 previous errors
35 For more information about this error, try `rustc --explain E0038`.