error[E0038]: the trait `Trait` cannot be made into an object
--> $DIR/issue-34373.rs:7:24
|
LL | pub struct Foo<T = Box<Trait<DefaultFoo>>>;
| ^^^^^^^^^^^^^^^^^ `Trait` cannot be made into an object
|
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>
--> $DIR/issue-34373.rs:4:8
|
LL | trait Trait<T> {
| ----- this trait cannot be made into an object...
LL | fn foo(_: T) {}
| ^^^ ...because associated function `foo` has no `self` parameter
help: consider turning `foo` into a method by giving it a `&self` argument
|
LL | fn foo(&self, _: T) {}
| ++++++
help: alternatively, consider constraining `foo` so it does not apply to trait objects