2024-01-23 18:24:40 +00:00
error: trait objects without an explicit `dyn` are deprecated
2024-04-07 16:36:44 +00:00
--> $DIR/bare-trait-dont-suggest-dyn.rs:6:33
2024-01-23 18:24:40 +00:00
|
LL | fn ord_prefer_dot(s: String) -> Ord {
| ^^^
|
= 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: the lint level is defined here
2024-04-07 16:36:44 +00:00
--> $DIR/bare-trait-dont-suggest-dyn.rs:5:9
2024-01-23 18:24:40 +00:00
|
LL | #![deny(bare_trait_objects)]
| ^^^^^^^^^^^^^^^^^^
2024-09-25 10:38:40 +02:00
help: if this is a dyn-compatible trait, use `dyn`
2024-01-23 18:24:40 +00:00
|
LL | fn ord_prefer_dot(s: String) -> dyn Ord {
| +++
2024-01-03 21:00:04 +00:00
error[E0038]: the trait `Ord` cannot be made into an object
2024-04-07 16:36:44 +00:00
--> $DIR/bare-trait-dont-suggest-dyn.rs:6:33
2024-01-03 21:00:04 +00:00
|
LL | fn ord_prefer_dot(s: String) -> Ord {
| ^^^ `Ord` cannot be made into an object
|
2024-09-25 10:38:40 +02: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-01-03 21:00:04 +00:00
--> $SRC_DIR/core/src/cmp.rs:LL:COL
|
= note: the trait cannot be made into an object because it uses `Self` as a type parameter
::: $SRC_DIR/core/src/cmp.rs:LL:COL
|
= note: the trait cannot be made into an object because it uses `Self` as a type parameter
2024-01-03 23:40:49 +00:00
help: consider using an opaque type instead
|
LL | fn ord_prefer_dot(s: String) -> impl Ord {
| ++++
2024-01-03 21:00:04 +00:00
2024-01-23 18:24:40 +00:00
error: aborting due to 2 previous errors
2024-01-03 21:00:04 +00:00
For more information about this error, try `rustc --explain E0038`.