1010
1111use self :: Destination :: * ;
1212
13- use syntax_pos:: { DUMMY_SP , FileMap , Span , MultiSpan } ;
13+ use syntax_pos:: { FileMap , Span , MultiSpan } ;
1414
1515use { Level , CodeSuggestion , DiagnosticBuilder , SubDiagnostic , CodeMapperDyn , DiagnosticId } ;
1616use snippet:: { Annotation , AnnotationType , Line , MultilineAnnotation , StyledString , Style } ;
@@ -216,7 +216,7 @@ impl EmitterWriter {
216216
217217 if let Some ( ref cm) = self . cm {
218218 for span_label in msp. span_labels ( ) {
219- if span_label. span == DUMMY_SP {
219+ if span_label. span . is_dummy ( ) {
220220 continue ;
221221 }
222222
@@ -730,7 +730,7 @@ impl EmitterWriter {
730730 let mut max = 0 ;
731731 if let Some ( ref cm) = self . cm {
732732 for primary_span in msp. primary_spans ( ) {
733- if primary_span != & DUMMY_SP {
733+ if !primary_span . is_dummy ( ) {
734734 let hi = cm. lookup_char_pos ( primary_span. hi ( ) ) ;
735735 if hi. line > max {
736736 max = hi. line ;
@@ -739,7 +739,7 @@ impl EmitterWriter {
739739 }
740740 if !self . short_message {
741741 for span_label in msp. span_labels ( ) {
742- if span_label. span != DUMMY_SP {
742+ if ! span_label. span . is_dummy ( ) {
743743 let hi = cm. lookup_char_pos ( span_label. span . hi ( ) ) ;
744744 if hi. line > max {
745745 max = hi. line ;
@@ -778,7 +778,7 @@ impl EmitterWriter {
778778
779779 // First, find all the spans in <*macros> and point instead at their use site
780780 for sp in span. primary_spans ( ) {
781- if * sp == DUMMY_SP {
781+ if sp . is_dummy ( ) {
782782 continue ;
783783 }
784784 let call_sp = cm. call_span_if_macro ( * sp) ;
@@ -790,7 +790,7 @@ impl EmitterWriter {
790790 // Only show macro locations that are local
791791 // and display them like a span_note
792792 if let Some ( def_site) = trace. def_site_span {
793- if def_site == DUMMY_SP {
793+ if def_site. is_dummy ( ) {
794794 continue ;
795795 }
796796 if always_backtrace {
@@ -830,7 +830,7 @@ impl EmitterWriter {
830830 span. push_span_label ( label_span, label_text) ;
831831 }
832832 for sp_label in span. span_labels ( ) {
833- if sp_label. span == DUMMY_SP {
833+ if sp_label. span . is_dummy ( ) {
834834 continue ;
835835 }
836836 if cm. span_to_filename ( sp_label. span . clone ( ) ) . is_macros ( ) &&
@@ -1003,7 +1003,7 @@ impl EmitterWriter {
10031003 // Make sure our primary file comes first
10041004 let ( primary_lo, cm) = if let ( Some ( cm) , Some ( ref primary_span) ) =
10051005 ( self . cm . as_ref ( ) , msp. primary_span ( ) . as_ref ( ) ) {
1006- if primary_span != & & DUMMY_SP {
1006+ if !primary_span . is_dummy ( ) {
10071007 ( cm. lookup_char_pos ( primary_span. lo ( ) ) , cm)
10081008 } else {
10091009 emit_to_destination ( & buffer. render ( ) , level, & mut self . dst , self . short_message ) ?;
0 commit comments