Skip to content

Commit

Permalink
remove is_local_span as it is no longer used
Browse files Browse the repository at this point in the history
  • Loading branch information
TaKO8Ki committed Jul 25, 2022
1 parent 3ae03e0 commit bf1a5e7
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions compiler/rustc_span/src/source_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -586,17 +586,6 @@ impl SourceMap {
}
}

/// Returns whether or not this span points into a file
/// in the current crate. This may be `false` for spans
/// produced by a macro expansion, or for spans associated
/// with the definition of an item in a foreign crate
pub fn is_local_span(&self, sp: Span) -> bool {
let local_begin = self.lookup_byte_offset(sp.lo());
let local_end = self.lookup_byte_offset(sp.hi());
// This might be a weird span that covers multiple files
local_begin.sf.src.is_some() && local_end.sf.src.is_some()
}

pub fn is_span_accessible(&self, sp: Span) -> bool {
self.span_to_source(sp, |src, start_index, end_index| {
Ok(src.get(start_index..end_index).is_some())
Expand Down

0 comments on commit bf1a5e7

Please sign in to comment.