You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rollup merge of #133372 - cramertj:rework-dyn-suggestions, r=fmease
Refactor dyn-compatibility error and suggestions
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
r? `@compiler-errors`
"for a trait to be dyn compatible it needs to allow building a vtable\n\
489
+
for more information, visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>",
506
490
);
507
491
508
492
// Only provide the help if its a local trait, otherwise it's not actionable.
| ^^^^^^^^^^^^^^^^^^^^ `X` cannot be made into an object
99
+
| ^^^^^^^^^^^^^^^^^^^^ `X` is not dyn compatible
100
100
|
101
-
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>
101
+
note: for a trait to be dyn compatible it needs to allow building a vtable
102
+
for more information, visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ `SVec` cannot be made into an object
301
+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ `SVec` is not dyn compatible
302
302
|
303
-
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>
303
+
note: for a trait to be dyn compatible it needs to allow building a vtable
304
+
for more information, visit <https://doc.rust-lang.org/reference/items/traits.html#object-safety>
0 commit comments