@@ -20,7 +20,7 @@ use std::borrow::Cow;
2020use std:: iter:: { self } ;
2121use syntax:: ast:: { self } ;
2222use syntax:: symbol:: InternedString ;
23- use syntax_pos:: Span ;
23+ use syntax_pos:: { Span , DUMMY_SP } ;
2424
2525#[ derive( Copy , Clone , Debug , PartialEq , Eq , Hash ) ]
2626pub enum ObjectSafetyViolation {
@@ -49,7 +49,7 @@ impl ObjectSafetyViolation {
4949 ObjectSafetyViolation :: Method ( name, MethodViolationCode :: StaticMethod , _) =>
5050 format ! ( "associated function `{}` has no `self` parameter" , name) . into ( ) ,
5151 ObjectSafetyViolation :: Method ( name, MethodViolationCode :: ReferencesSelf , _) => format ! (
52- "method `{}` references the `Self` type in its arguments or return type" ,
52+ "method `{}` references the `Self` type in its parameters or return type" ,
5353 name,
5454 ) . into ( ) ,
5555 ObjectSafetyViolation :: Method (
@@ -67,9 +67,9 @@ impl ObjectSafetyViolation {
6767 }
6868
6969 pub fn span ( & self ) -> Option < Span > {
70- match self {
70+ match * self {
7171 ObjectSafetyViolation :: AssocConst ( _, span) |
72- ObjectSafetyViolation :: Method ( _, _, span) = > Some ( * span) ,
72+ ObjectSafetyViolation :: Method ( _, _, span) if span != DUMMY_SP = > Some ( span) ,
7373 _ => None ,
7474 }
7575 }
0 commit comments