diff options
| author | Brian Koropoff <bkoropoff@gmail.com> | 2014-09-12 21:52:56 -0700 |
|---|---|---|
| committer | Brian Koropoff <bkoropoff@gmail.com> | 2014-09-12 21:52:56 -0700 |
| commit | 26d716a5006f72f398e051757adc031c0b507b4f (patch) | |
| tree | b459cf2f44042dcae93c7995ca02565fb3a8f70f | |
| parent | ccae356aced284a964910006af22dc005ea073a2 (diff) | |
| download | rust-26d716a5006f72f398e051757adc031c0b507b4f.tar.gz rust-26d716a5006f72f398e051757adc031c0b507b4f.zip | |
Remove unused, unsound method on StrInterner
The string slices returned by `get_ref` can actually be invalidated by calling `clear`. Since this method is unused, it is easiest to simply remove it. Closes #17181
| -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() } |
