@@ -803,7 +803,7 @@ fn non_exhaustive_match<'p, 'tcx>(
803803 let mut suggestion = None ;
804804 let sm = cx. tcx . sess . source_map ( ) ;
805805 match arms {
806- [ ] if sp. ctxt ( ) == expr_span. ctxt ( ) => {
806+ [ ] if sp. eq_ctxt ( expr_span) => {
807807 // Get the span for the empty match body `{}`.
808808 let ( indentation, more) = if let Some ( snippet) = sm. indentation_before ( sp) {
809809 ( format ! ( "\n {}" , snippet) , " " )
@@ -830,7 +830,7 @@ fn non_exhaustive_match<'p, 'tcx>(
830830 " " . to_string ( )
831831 } ;
832832 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 )
834834 {
835835 ""
836836 } else {
@@ -841,10 +841,10 @@ fn non_exhaustive_match<'p, 'tcx>(
841841 format ! ( "{}{}{} => todo!()" , comma, pre_indentation, pattern) ,
842842 ) ) ;
843843 }
844- [ .., prev, last] if prev. span . ctxt ( ) == last. span . ctxt ( ) => {
844+ [ .., prev, last] if prev. span . eq_ctxt ( last. span ) => {
845845 if let Ok ( snippet) = sm. span_to_snippet ( prev. span . between ( last. span ) ) {
846846 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 )
848848 {
849849 ""
850850 } else {
0 commit comments