1 error[E0038]: the trait `NotObjectSafe` cannot be made into an object
2 --> $DIR/object-unsafe-trait-in-return-position-dyn-trait.rs:21:13
4 LL | trait NotObjectSafe {
5 | ------------- this trait cannot be made into an object...
7 | --- ...because associated function `foo` has no `self` parameter
9 LL | fn car() -> dyn NotObjectSafe {
10 | ^^^^^^^^^^^^^^^^^ the trait `NotObjectSafe` cannot be made into an object
12 help: consider turning `foo` into a method by giving it a `&self` argument or constraining it so it does not apply to trait objects
14 LL | fn foo() -> Self where Self: Sized;
17 error[E0038]: the trait `NotObjectSafe` cannot be made into an object
18 --> $DIR/object-unsafe-trait-in-return-position-dyn-trait.rs:28:13
20 LL | trait NotObjectSafe {
21 | ------------- this trait cannot be made into an object...
22 LL | fn foo() -> Self;
23 | --- ...because associated function `foo` has no `self` parameter
25 LL | fn cat() -> Box<dyn NotObjectSafe> {
26 | ^^^^^^^^^^^^^^^^^^^^^^ the trait `NotObjectSafe` cannot be made into an object
28 help: consider turning `foo` into a method by giving it a `&self` argument or constraining it so it does not apply to trait objects
30 LL | fn foo() -> Self where Self: Sized;
33 error: aborting due to 2 previous errors
35 For more information about this error, try `rustc --explain E0038`.