- ObjectSafetyViolation::SupertraitSelf => {
- "it cannot use `Self` as a type parameter in the supertraits or `where`-clauses"
- .into()
+ ObjectSafetyViolation::SupertraitSelf(ref spans) => {
+ if spans.iter().any(|sp| *sp != DUMMY_SP) {
+ "it uses `Self` as a type parameter in this".into()
+ } else {
+ "it cannot use `Self` as a type parameter in a supertrait or `where`-clause"
+ .into()
+ }