]> git.lizzy.rs Git - rust.git/commitdiff
Remove `LocalInternedString::intern`.
authorNicholas Nethercote <nnethercote@mozilla.com>
Tue, 3 Sep 2019 23:49:23 +0000 (09:49 +1000)
committerNicholas Nethercote <nnethercote@mozilla.com>
Wed, 4 Sep 2019 04:41:09 +0000 (14:41 +1000)
src/libsyntax_pos/symbol.rs

index 32ca1fdff93931236d51dd2e953b8802d3ade924..5c6031327013c5fbce92de08c152e70e17972694 100644 (file)
@@ -1157,19 +1157,6 @@ pub struct LocalInternedString {
     string: &'static str,
 }
 
-impl LocalInternedString {
-    /// Maps a string to its interned representation.
-    pub fn intern(string: &str) -> Self {
-        let string = with_interner(|interner| {
-            let symbol = interner.intern(string);
-            interner.strings[symbol.0.as_usize()]
-        });
-        LocalInternedString {
-            string: unsafe { std::mem::transmute::<&str, &str>(string) }
-        }
-    }
-}
-
 impl<U: ?Sized> std::convert::AsRef<U> for LocalInternedString
 where
     str: std::convert::AsRef<U>