Remove LocalInternedString::get
.
It has a single use, which is easily changed to something better.
This commit is contained in:
parent
69ae8d9dfd
commit
224daa64bd
2 changed files with 1 additions and 10 deletions
|
@ -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(()),
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue