
This CL makes a number of small changes to dyn compatibility errors: - "object safety" has been renamed to "dyn-compatibility" throughout - "Convert to enum" suggestions are no longer generated when there exists a type-generic impl of the trait or an impl for `dyn OtherTrait` - Several error messages are reorganized for user readability Additionally, the dyn compatibility error creation code has been split out into functions. cc #132713 cc #133267
15 lines
649 B
Text
15 lines
649 B
Text
error[E0038]: the trait `AsyncFnMut` is not dyn compatible
|
|
--> $DIR/dyn-pos.rs:3:16
|
|
|
|
|
LL | fn foo(x: &dyn AsyncFn()) {}
|
|
| ^^^^^^^^^ `AsyncFnMut` is not dyn compatible
|
|
|
|
|
note: for a trait to be dyn compatible it needs to allow building a vtable
|
|
for more information, visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
|
|
--> $SRC_DIR/core/src/ops/async_function.rs:LL:COL
|
|
|
|
|
= note: the trait is not dyn compatible because it contains the generic associated type `CallRefFuture`
|
|
|
|
error: aborting due to 1 previous error
|
|
|
|
For more information about this error, try `rustc --explain E0038`.
|