1 error[E0038]: the trait `Bar` cannot be made into an object
2 --> $DIR/object-safety-mentions-Self.rs:22:30
4 LL | fn bar(&self, x: &Self);
5 | --- method `bar` references the `Self` type in its parameters or return type
7 LL | fn make_bar<T:Bar>(t: &T) -> &dyn Bar {
8 | ^^^^^^^^ the trait `Bar` cannot be made into an object
10 error[E0038]: the trait `Baz` cannot be made into an object
11 --> $DIR/object-safety-mentions-Self.rs:28:30
13 LL | fn baz(&self) -> Self;
14 | --- method `baz` references the `Self` type in its parameters or return type
16 LL | fn make_baz<T:Baz>(t: &T) -> &dyn Baz {
17 | ^^^^^^^^ the trait `Baz` cannot be made into an object
19 error: aborting due to 2 previous errors
21 For more information about this error, try `rustc --explain E0038`.