error[E0107]: wrong number of type arguments: expected 0, found 1 --> $DIR/trait-test-2.rs:9:14 | LL | 10.dup::(); | ^^^ unexpected type argument error[E0107]: wrong number of type arguments: expected 1, found 2 --> $DIR/trait-test-2.rs:10:20 | LL | 10.blah::(); | ^^^ unexpected type argument error[E0038]: the trait `bar` cannot be made into an object --> $DIR/trait-test-2.rs:11:16 | LL | (box 10 as Box).dup(); | ^^^^^^^^^^^^ `bar` cannot be made into an object | = help: consider moving `dup` to another trait = help: consider moving `blah` to another trait 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 --> $DIR/trait-test-2.rs:4:30 | LL | trait bar { fn dup(&self) -> Self; fn blah(&self); } | --- ^^^^ ^^^^ ...because method `blah` has generic type parameters | | | | | ...because method `dup` references the `Self` type in its return type | this trait cannot be made into an object... error[E0038]: the trait `bar` cannot be made into an object --> $DIR/trait-test-2.rs:11:6 | LL | (box 10 as Box).dup(); | ^^^^^^ `bar` cannot be made into an object | = help: consider moving `dup` to another trait = help: consider moving `blah` to another trait 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 --> $DIR/trait-test-2.rs:4:30 | LL | trait bar { fn dup(&self) -> Self; fn blah(&self); } | --- ^^^^ ^^^^ ...because method `blah` has generic type parameters | | | | | ...because method `dup` references the `Self` type in its return type | this trait cannot be made into an object... = note: required because of the requirements on the impl of `CoerceUnsized>` for `Box<{integer}>` = note: required by cast to type `Box` error: aborting due to 4 previous errors Some errors have detailed explanations: E0038, E0107. For more information about an error, try `rustc --explain E0038`.