MCPcopy Create free account
hub / github.com/Rust-for-Linux/klint / recover_span

Function recover_span

src/binary_analysis/reconstruct.rs:70–78  ·  view source on GitHub ↗

Compare a recovered span from a compiler-produced span, and determine if they're likely the same source.

(recover_span: Span, span: Span)

Source from the content-addressed store, hash-verified

68
69// Compare a recovered span from a compiler-produced span, and determine if they're likely the same source.
70pub 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
80pub fn recover_fn_call_span<'tcx>(
81 tcx: TyCtxt<'tcx>,

Callers 1

recover_fn_call_spanFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected