about summary refs log tree commit diff
path: root/compiler/rustc_span/src
diff options
context:
space:
mode:
authorYuki Okushi <jtitor@2k36.org>2022-07-26 13:12:23 +0900
committerGitHub <noreply@github.com>2022-07-26 13:12:23 +0900
commit85afb907889565c69cf8477ad09d52f94744bd54 (patch)
tree607765b7bf22fd9b2088498d176110809c755372 /compiler/rustc_span/src
parent3c1eef2e91dda0b97aa604e519ebb5fc98fbdbb2 (diff)
parent051e98b7bf7a2ab095516a9b3912d6120b5b8c91 (diff)
downloadrust-85afb907889565c69cf8477ad09d52f94744bd54.tar.gz
rust-85afb907889565c69cf8477ad09d52f94744bd54.zip
Rollup merge of #99718 - TaKO8Ki:avoid-&str-symbol-to-string-conversions, r=michaelwoerister
Avoid `&str`/`Symbol` to `String` conversions

follow-up to #99342 and #98668
Diffstat (limited to 'compiler/rustc_span/src')
-rw-r--r--compiler/rustc_span/src/source_map.rs11
1 files changed, 0 insertions, 11 deletions
diff --git a/compiler/rustc_span/src/source_map.rs b/compiler/rustc_span/src/source_map.rs
index b4a4424e876..47159584afe 100644
--- a/compiler/rustc_span/src/source_map.rs
+++ b/compiler/rustc_span/src/source_map.rs
@@ -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())