diff options
| author | Nicholas Nethercote <nnethercote@mozilla.com> | 2019-09-04 09:30:54 +1000 |
|---|---|---|
| committer | Nicholas Nethercote <nnethercote@mozilla.com> | 2019-09-04 14:40:23 +1000 |
| commit | 224daa64bd3d8f34afaacd73ffc972153fe75eda (patch) | |
| tree | 99f01f3abe297935bbce98016b13e35599c1f2a8 | |
| parent | 69ae8d9dfd9927d3db9d1d2676ca429c76007405 (diff) | |
| download | rust-224daa64bd3d8f34afaacd73ffc972153fe75eda.tar.gz rust-224daa64bd3d8f34afaacd73ffc972153fe75eda.zip | |
Remove `LocalInternedString::get`.
It has a single use, which is easily changed to something better.
| -rw-r--r-- | src/librustc_mir/borrow_check/error_reporting.rs | 2 | ||||
| -rw-r--r-- | src/libsyntax_pos/symbol.rs | 9 |
2 files changed, 1 insertions, 10 deletions
diff --git a/src/librustc_mir/borrow_check/error_reporting.rs b/src/librustc_mir/borrow_check/error_reporting.rs index 251d4b727c7..9f25e98052e 100644 --- a/src/librustc_mir/borrow_check/error_reporting.rs +++ b/src/librustc_mir/borrow_check/error_reporting.rs @@ -336,7 +336,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> { let local = &self.body.local_decls[local_index]; match local.name { Some(name) if !local.from_compiler_desugaring() => { - buf.push_str(name.as_str().get()); + buf.push_str(&name.as_str()); Ok(()) } _ => Err(()), diff --git a/src/libsyntax_pos/symbol.rs b/src/libsyntax_pos/symbol.rs index 42db2d21991..6c47ff823b9 100644 --- a/src/libsyntax_pos/symbol.rs +++ b/src/libsyntax_pos/symbol.rs @@ -1168,15 +1168,6 @@ impl LocalInternedString { string: unsafe { std::mem::transmute::<&str, &str>(string) } } } - - #[inline] - pub fn get(&self) -> &str { - // This returns a valid string since we ensure that `self` outlives the interner - // by creating the interner on a thread which outlives threads which can access it. - // This type cannot move to a thread which outlives the interner since it does - // not implement Send. - self.string - } } impl<U: ?Sized> std::convert::AsRef<U> for LocalInternedString |
