mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-11 16:15:03 +00:00
90 lines
3.7 KiB
Plaintext
90 lines
3.7 KiB
Plaintext
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
|
|
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 <https://doc.rust-lang.org/nightly/edition-guide/rust-2021/warnings-promoted-to-error.html>
|
|
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 <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`
|
|
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 <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
|
|
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 <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`
|
|
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 <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
|
|
--> $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`.
|