2024-11-20 14:19:36 -08:00
|
|
|
error[E0038]: the trait `Bar` is not dyn compatible
|
2020-05-29 08:27:59 +09:00
|
|
|
--> $DIR/issue-72410.rs:14:19
|
|
|
|
|
|
|
2020-10-15 17:23:45 -07:00
|
|
|
LL | where for<'a> &'a mut [dyn Bar]: ;
|
2024-11-20 14:19:36 -08:00
|
|
|
| ^^^^^^^^^^^^^^^^^ `Bar` is not dyn compatible
|
2020-10-15 17:23:45 -07:00
|
|
|
|
|
2024-11-20 14:19:36 -08:00
|
|
|
note: for a trait to be dyn compatible it needs to allow building a vtable
|
2025-01-22 05:14:07 +01:00
|
|
|
for more information, visit <https://doc.rust-lang.org/reference/items/traits.html#dyn-compatibility>
|
2020-10-15 17:23:45 -07:00
|
|
|
--> $DIR/issue-72410.rs:13:8
|
|
|
|
|
|
|
2020-05-29 08:27:59 +09:00
|
|
|
LL | pub trait Bar {
|
2024-11-20 14:19:36 -08:00
|
|
|
| --- this trait is not dyn compatible...
|
2020-05-29 08:27:59 +09:00
|
|
|
LL | fn map()
|
2020-10-15 17:23:45 -07:00
|
|
|
| ^^^ ...because associated function `map` has no `self` parameter
|
|
|
|
|
help: consider turning `map` into a method by giving it a `&self` argument
|
2020-05-29 08:27:59 +09:00
|
|
|
|
|
2020-10-15 17:23:45 -07:00
|
|
|
LL | fn map(&self)
|
2021-06-21 19:07:19 -07:00
|
|
|
| +++++
|
2020-10-15 17:23:45 -07:00
|
|
|
help: alternatively, consider constraining `map` so it does not apply to trait objects
|
2020-05-29 08:27:59 +09:00
|
|
|
|
|
|
|
|
|
LL | where for<'a> &'a mut [dyn Bar]:, Self: Sized ;
|
2021-06-21 19:07:19 -07:00
|
|
|
| +++++++++++++
|
2020-05-29 08:27:59 +09:00
|
|
|
|
2023-11-21 15:44:16 +00:00
|
|
|
error: aborting due to 1 previous error
|
2020-05-29 08:27:59 +09:00
|
|
|
|
|
|
|
|
For more information about this error, try `rustc --explain E0038`.
|