warning: trait objects without an explicit `dyn` are deprecated --> $DIR/issue-116434-2015.rs:3:17 | LL | fn foo() -> Clone; | ^^^^^ | = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! = note: for more information, see = note: `#[warn(bare_trait_objects)]` on by default help: if this is an object-safe trait, use `dyn` | LL | fn foo() -> dyn Clone; | +++ warning: trait objects without an explicit `dyn` are deprecated --> $DIR/issue-116434-2015.rs:18:20 | LL | fn handle() -> DbHandle; | ^^^^^^^^ | = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! = note: for more information, see help: if this is an object-safe trait, use `dyn` | LL | fn handle() -> dyn DbHandle; | +++ warning: trait objects without an explicit `dyn` are deprecated --> $DIR/issue-116434-2015.rs:3:17 | LL | fn foo() -> Clone; | ^^^^^ | = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! = note: for more information, see = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` help: if this is an object-safe trait, use `dyn` | LL | fn foo() -> dyn Clone; | +++ error[E0038]: the trait `Clone` cannot be made into an object --> $DIR/issue-116434-2015.rs:3:17 | LL | fn foo() -> Clone; | ^^^^^ `Clone` cannot be made into an object | = note: the trait cannot be made into an object because it requires `Self: Sized` = 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 help: there is an associated type with the same name | LL | fn foo() -> Self::Clone; | ++++++ warning: trait objects without an explicit `dyn` are deprecated --> $DIR/issue-116434-2015.rs:18:20 | LL | fn handle() -> DbHandle; | ^^^^^^^^ | = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! = note: for more information, see = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` help: if this is an object-safe trait, use `dyn` | LL | fn handle() -> dyn DbHandle; | +++ error[E0038]: the trait `DbHandle` cannot be made into an object --> $DIR/issue-116434-2015.rs:18:20 | LL | fn handle() -> DbHandle; | ^^^^^^^^ `DbHandle` 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 --> $DIR/issue-116434-2015.rs:14:17 | LL | trait DbHandle: Sized {} | -------- ^^^^^ ...because it requires `Self: Sized` | | | this trait cannot be made into an object... help: there is an associated type with the same name | LL | fn handle() -> Self::DbHandle; | ++++++ error: aborting due to 2 previous errors; 4 warnings emitted For more information about this error, try `rustc --explain E0038`.