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
This commit is contained in:
@@ -272,7 +272,7 @@ declare_features! (
|
||||
(unstable, doc_notable_trait, "1.52.0", Some(45040)),
|
||||
/// Allows using the `may_dangle` attribute (RFC 1327).
|
||||
(unstable, dropck_eyepatch, "1.10.0", Some(34761)),
|
||||
/// Allows making `dyn Trait` well-formed even if `Trait` is not dyn-compatible[^1].
|
||||
/// Allows making `dyn Trait` well-formed even if `Trait` is not dyn compatible[^1].
|
||||
/// In that case, `dyn Trait: Trait` does not hold. Moreover, coercions and
|
||||
/// casts in safe Rust to `dyn Trait` for such a `Trait` is also forbidden.
|
||||
///
|
||||
|
||||
Reference in New Issue
Block a user