Compare a recovered span from a compiler-produced span, and determine if they're likely the same source.
(recover_span: Span, span: Span)
| 68 | |
| 69 | // Compare a recovered span from a compiler-produced span, and determine if they're likely the same source. |
| 70 | pub fn recover_span<'tcx>(recover_span: Span, span: Span) -> bool { |
| 71 | // Recovered span is produced through debug info. This will undergo the debuginfo collapse process. |
| 72 | // Before comparing, undergo the same process for `span`. |
| 73 | |
| 74 | let collapsed = rustc_span::hygiene::walk_chain_collapsed(span, DUMMY_SP); |
| 75 | |
| 76 | let range = collapsed.lo()..collapsed.hi(); |
| 77 | range.contains(&recover_span.lo()) |
| 78 | } |
| 79 | |
| 80 | pub fn recover_fn_call_span<'tcx>( |
| 81 | tcx: TyCtxt<'tcx>, |
no outgoing calls
no test coverage detected