Deny RPITIT for object safety
This commit is contained in:
@@ -908,6 +908,12 @@ impl ObjectSafetyViolation {
|
||||
ObjectSafetyViolation::Method(name, MethodViolationCode::ReferencesSelfOutput, _) => {
|
||||
format!("method `{}` references the `Self` type in its return type", name).into()
|
||||
}
|
||||
ObjectSafetyViolation::Method(
|
||||
name,
|
||||
MethodViolationCode::ReferencesImplTraitInTrait,
|
||||
_,
|
||||
) => format!("method `{}` references an `impl Trait` type in its return type", name)
|
||||
.into(),
|
||||
ObjectSafetyViolation::Method(
|
||||
name,
|
||||
MethodViolationCode::WhereClauseReferencesSelf,
|
||||
@@ -1014,6 +1020,9 @@ pub enum MethodViolationCode {
|
||||
/// e.g., `fn foo(&self) -> Self`
|
||||
ReferencesSelfOutput,
|
||||
|
||||
/// e.g., `fn foo(&self) -> impl Sized`
|
||||
ReferencesImplTraitInTrait,
|
||||
|
||||
/// e.g., `fn foo(&self) where Self: Clone`
|
||||
WhereClauseReferencesSelf,
|
||||
|
||||
|
||||
Reference in New Issue
Block a user