@@ -803,7 +803,7 @@ fn non_exhaustive_match<'p, 'tcx>(
803
803
let mut suggestion = None ;
804
804
let sm = cx. tcx . sess . source_map ( ) ;
805
805
match arms {
806
- [ ] if sp. ctxt ( ) == expr_span. ctxt ( ) => {
806
+ [ ] if sp. eq_ctxt ( expr_span) => {
807
807
// Get the span for the empty match body `{}`.
808
808
let ( indentation, more) = if let Some ( snippet) = sm. indentation_before ( sp) {
809
809
( format ! ( "\n {}" , snippet) , " " )
@@ -830,7 +830,7 @@ fn non_exhaustive_match<'p, 'tcx>(
830
830
" " . to_string ( )
831
831
} ;
832
832
let comma = if matches ! ( only. body. kind, hir:: ExprKind :: Block ( ..) )
833
- && only. span . ctxt ( ) == only. body . span . ctxt ( )
833
+ && only. span . eq_ctxt ( only. body . span )
834
834
{
835
835
""
836
836
} else {
@@ -841,10 +841,10 @@ fn non_exhaustive_match<'p, 'tcx>(
841
841
format ! ( "{}{}{} => todo!()" , comma, pre_indentation, pattern) ,
842
842
) ) ;
843
843
}
844
- [ .., prev, last] if prev. span . ctxt ( ) == last. span . ctxt ( ) => {
844
+ [ .., prev, last] if prev. span . eq_ctxt ( last. span ) => {
845
845
if let Ok ( snippet) = sm. span_to_snippet ( prev. span . between ( last. span ) ) {
846
846
let comma = if matches ! ( last. body. kind, hir:: ExprKind :: Block ( ..) )
847
- && last. span . ctxt ( ) == last. body . span . ctxt ( )
847
+ && last. span . eq_ctxt ( last. body . span )
848
848
{
849
849
""
850
850
} else {
0 commit comments