diff options
| author | bors <bors@rust-lang.org> | 2014-09-15 21:56:00 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2014-09-15 21:56:00 +0000 |
| commit | 63eaba24d6a7f93061d63337ea1f7083ca892787 (patch) | |
| tree | 67d3028a198c0d86e76cd7f12dfd4413754c8a9b /src/libsyntax | |
| parent | 382fc4575925984eca66fc6498569461732f3c1d (diff) | |
| parent | 26d716a5006f72f398e051757adc031c0b507b4f (diff) | |
| download | rust-63eaba24d6a7f93061d63337ea1f7083ca892787.tar.gz rust-63eaba24d6a7f93061d63337ea1f7083ca892787.zip | |
auto merge of #17221 : bkoropoff/rust/strinterner-unsafe, r=sfackler
The `StrInterner::clear()` method takes self immutably but can invalidate references returned by `StrInterner::get_ref`. Since `get_ref` is unused, just remove it. Closes #17181
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/util/interner.rs | 11 |
1 files changed, 0 insertions, 11 deletions
diff --git a/src/libsyntax/util/interner.rs b/src/libsyntax/util/interner.rs index 452b5a52512..9ad3157fe6a 100644 --- a/src/libsyntax/util/interner.rs +++ b/src/libsyntax/util/interner.rs @@ -19,7 +19,6 @@ use std::cell::RefCell; use std::cmp::Equiv; use std::fmt; use std::hash::Hash; -use std::mem; use std::rc::Rc; pub struct Interner<T> { @@ -192,16 +191,6 @@ impl StrInterner { (*self.vect.borrow().get(idx.uint())).clone() } - /// Returns this string with lifetime tied to the interner. Since - /// strings may never be removed from the interner, this is safe. - pub fn get_ref<'a>(&'a self, idx: Name) -> &'a str { - let vect = self.vect.borrow(); - let s: &str = vect.get(idx.uint()).as_slice(); - unsafe { - mem::transmute(s) - } - } - pub fn len(&self) -> uint { self.vect.borrow().len() } |
