2024-01-20 02:41:56 -06:00
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 <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
= note: `#[warn(bare_trait_objects)]` on by default
2024-09-25 03:38:40 -05:00
help: if this is a dyn-compatible trait, use `dyn`
2024-01-20 02:41:56 -06:00
|
LL | fn foo() -> dyn Clone;
| +++
warning: trait objects without an explicit `dyn` are deprecated
2024-02-14 14:42:32 -06:00
--> $DIR/issue-116434-2015.rs:18:20
2024-01-20 02:41:56 -06:00
|
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 <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
2024-09-25 03:38:40 -05:00
help: if this is a dyn-compatible trait, use `dyn`
2024-01-20 02:41:56 -06:00
|
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 <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
2024-09-25 03:38:40 -05:00
help: if this is a dyn-compatible trait, use `dyn`
2024-01-20 02:41:56 -06:00
|
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`
2024-09-25 03:38:40 -05:00
= note: for a trait to be "dyn-compatible" 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>
2024-02-14 14:42:32 -06:00
help: there is an associated type with the same name
|
LL | fn foo() -> Self::Clone;
| ++++++
2024-01-20 02:41:56 -06:00
warning: trait objects without an explicit `dyn` are deprecated
2024-02-14 14:42:32 -06:00
--> $DIR/issue-116434-2015.rs:18:20
2024-01-20 02:41:56 -06:00
|
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 <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
2024-09-25 03:38:40 -05:00
help: if this is a dyn-compatible trait, use `dyn`
2024-01-20 02:41:56 -06:00
|
LL | fn handle() -> dyn DbHandle;
| +++
error[E0038]: the trait `DbHandle` cannot be made into an object
2024-02-14 14:42:32 -06:00
--> $DIR/issue-116434-2015.rs:18:20
2024-01-20 02:41:56 -06:00
|
LL | fn handle() -> DbHandle;
| ^^^^^^^^ `DbHandle` cannot be made into an object
|
2024-09-25 03:38:40 -05:00
note: for a trait to be "dyn-compatible" 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>
2024-02-14 14:42:32 -06:00
--> $DIR/issue-116434-2015.rs:14:17
2024-01-20 02:41:56 -06:00
|
LL | trait DbHandle: Sized {}
| -------- ^^^^^ ...because it requires `Self: Sized`
| |
| this trait cannot be made into an object...
2024-02-14 14:42:32 -06:00
help: there is an associated type with the same name
|
LL | fn handle() -> Self::DbHandle;
| ++++++
2024-01-20 02:41:56 -06:00
error: aborting due to 2 previous errors; 4 warnings emitted
For more information about this error, try `rustc --explain E0038`.