We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
is_local_span
1 parent 3ae03e0 commit bf1a5e7Copy full SHA for bf1a5e7
compiler/rustc_span/src/source_map.rs
@@ -586,17 +586,6 @@ impl SourceMap {
586
}
587
588
589
- /// Returns whether or not this span points into a file
590
- /// in the current crate. This may be `false` for spans
591
- /// produced by a macro expansion, or for spans associated
592
- /// with the definition of an item in a foreign crate
593
- pub fn is_local_span(&self, sp: Span) -> bool {
594
- let local_begin = self.lookup_byte_offset(sp.lo());
595
- let local_end = self.lookup_byte_offset(sp.hi());
596
- // This might be a weird span that covers multiple files
597
- local_begin.sf.src.is_some() && local_end.sf.src.is_some()
598
- }
599
-
600
pub fn is_span_accessible(&self, sp: Span) -> bool {
601
self.span_to_source(sp, |src, start_index, end_index| {
602
Ok(src.get(start_index..end_index).is_some())
0 commit comments