10
10
11
11
use self :: Destination :: * ;
12
12
13
- use syntax_pos:: { DUMMY_SP , FileMap , Span , MultiSpan } ;
13
+ use syntax_pos:: { FileMap , Span , MultiSpan } ;
14
14
15
15
use { Level , CodeSuggestion , DiagnosticBuilder , SubDiagnostic , CodeMapperDyn , DiagnosticId } ;
16
16
use snippet:: { Annotation , AnnotationType , Line , MultilineAnnotation , StyledString , Style } ;
@@ -216,7 +216,7 @@ impl EmitterWriter {
216
216
217
217
if let Some ( ref cm) = self . cm {
218
218
for span_label in msp. span_labels ( ) {
219
- if span_label. span == DUMMY_SP {
219
+ if span_label. span . is_dummy ( ) {
220
220
continue ;
221
221
}
222
222
@@ -730,7 +730,7 @@ impl EmitterWriter {
730
730
let mut max = 0 ;
731
731
if let Some ( ref cm) = self . cm {
732
732
for primary_span in msp. primary_spans ( ) {
733
- if primary_span != & DUMMY_SP {
733
+ if !primary_span . is_dummy ( ) {
734
734
let hi = cm. lookup_char_pos ( primary_span. hi ( ) ) ;
735
735
if hi. line > max {
736
736
max = hi. line ;
@@ -739,7 +739,7 @@ impl EmitterWriter {
739
739
}
740
740
if !self . short_message {
741
741
for span_label in msp. span_labels ( ) {
742
- if span_label. span != DUMMY_SP {
742
+ if ! span_label. span . is_dummy ( ) {
743
743
let hi = cm. lookup_char_pos ( span_label. span . hi ( ) ) ;
744
744
if hi. line > max {
745
745
max = hi. line ;
@@ -778,7 +778,7 @@ impl EmitterWriter {
778
778
779
779
// First, find all the spans in <*macros> and point instead at their use site
780
780
for sp in span. primary_spans ( ) {
781
- if * sp == DUMMY_SP {
781
+ if sp . is_dummy ( ) {
782
782
continue ;
783
783
}
784
784
let call_sp = cm. call_span_if_macro ( * sp) ;
@@ -790,7 +790,7 @@ impl EmitterWriter {
790
790
// Only show macro locations that are local
791
791
// and display them like a span_note
792
792
if let Some ( def_site) = trace. def_site_span {
793
- if def_site == DUMMY_SP {
793
+ if def_site. is_dummy ( ) {
794
794
continue ;
795
795
}
796
796
if always_backtrace {
@@ -830,7 +830,7 @@ impl EmitterWriter {
830
830
span. push_span_label ( label_span, label_text) ;
831
831
}
832
832
for sp_label in span. span_labels ( ) {
833
- if sp_label. span == DUMMY_SP {
833
+ if sp_label. span . is_dummy ( ) {
834
834
continue ;
835
835
}
836
836
if cm. span_to_filename ( sp_label. span . clone ( ) ) . is_macros ( ) &&
@@ -1003,7 +1003,7 @@ impl EmitterWriter {
1003
1003
// Make sure our primary file comes first
1004
1004
let ( primary_lo, cm) = if let ( Some ( cm) , Some ( ref primary_span) ) =
1005
1005
( self . cm . as_ref ( ) , msp. primary_span ( ) . as_ref ( ) ) {
1006
- if primary_span != & & DUMMY_SP {
1006
+ if !primary_span . is_dummy ( ) {
1007
1007
( cm. lookup_char_pos ( primary_span. lo ( ) ) , cm)
1008
1008
} else {
1009
1009
emit_to_destination ( & buffer. render ( ) , level, & mut self . dst , self . short_message ) ?;
0 commit comments