diff options
| author | Niko Matsakis <niko@alum.mit.edu> | 2013-06-15 20:26:59 -0400 |
|---|---|---|
| committer | Niko Matsakis <niko@alum.mit.edu> | 2013-06-16 12:47:36 -0400 |
| commit | eb48c296817be7529a1757ac8d4798112717eaa9 (patch) | |
| tree | d90d4c97be651ac615f86c6ff74b682218ee1e1c /src/libsyntax/util | |
| parent | 682bb4144ca3fddffee8ed2927e7552049fcf25c (diff) | |
| download | rust-eb48c296817be7529a1757ac8d4798112717eaa9.tar.gz rust-eb48c296817be7529a1757ac8d4798112717eaa9.zip | |
Add copies to type params with Copy bound
Diffstat (limited to 'src/libsyntax/util')
| -rw-r--r-- | src/libsyntax/util/interner.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/libsyntax/util/interner.rs b/src/libsyntax/util/interner.rs index d4f183ada7b..bd5c178e7fe 100644 --- a/src/libsyntax/util/interner.rs +++ b/src/libsyntax/util/interner.rs @@ -36,7 +36,7 @@ impl<T:Eq + IterBytes + Hash + Const + Copy> Interner<T> { pub fn prefill(init: &[T]) -> Interner<T> { let rv = Interner::new(); - for init.each() |v| { rv.intern(*v); } + for init.each() |v| { rv.intern(copy *v); } rv } @@ -48,7 +48,7 @@ impl<T:Eq + IterBytes + Hash + Const + Copy> Interner<T> { let vect = &mut *self.vect; let new_idx = vect.len(); - self.map.insert(val, new_idx); + self.map.insert(copy val, new_idx); vect.push(val); new_idx } @@ -63,7 +63,7 @@ impl<T:Eq + IterBytes + Hash + Const + Copy> Interner<T> { new_idx } - pub fn get(&self, idx: uint) -> T { self.vect[idx] } + pub fn get(&self, idx: uint) -> T { copy self.vect[idx] } pub fn len(&self) -> uint { let vect = &*self.vect; vect.len() } |
