Skip to content

Commit 224daa6

Browse files
committed
Remove LocalInternedString::get.
It has a single use, which is easily changed to something better.
1 parent 69ae8d9 commit 224daa6

File tree

2 files changed

+1
-10
lines changed

2 files changed

+1
-10
lines changed

src/librustc_mir/borrow_check/error_reporting.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
336336
let local = &self.body.local_decls[local_index];
337337
match local.name {
338338
Some(name) if !local.from_compiler_desugaring() => {
339-
buf.push_str(name.as_str().get());
339+
buf.push_str(&name.as_str());
340340
Ok(())
341341
}
342342
_ => Err(()),

src/libsyntax_pos/symbol.rs

-9
Original file line numberDiff line numberDiff line change
@@ -1168,15 +1168,6 @@ impl LocalInternedString {
11681168
string: unsafe { std::mem::transmute::<&str, &str>(string) }
11691169
}
11701170
}
1171-
1172-
#[inline]
1173-
pub fn get(&self) -> &str {
1174-
// This returns a valid string since we ensure that `self` outlives the interner
1175-
// by creating the interner on a thread which outlives threads which can access it.
1176-
// This type cannot move to a thread which outlives the interner since it does
1177-
// not implement Send.
1178-
self.string
1179-
}
11801171
}
11811172

11821173
impl<U: ?Sized> std::convert::AsRef<U> for LocalInternedString

0 commit comments

Comments
 (0)