From 198cc3d850136582651489328fec221a2b98bfef Mon Sep 17 00:00:00 2001 From: Patrick Walton Date: Fri, 28 Feb 2014 12:54:01 -0800 Subject: libsyntax: Fix errors arising from the automated `~[T]` conversion --- src/libsyntax/util/small_vector.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/libsyntax/util/small_vector.rs') diff --git a/src/libsyntax/util/small_vector.rs b/src/libsyntax/util/small_vector.rs index 22bf0f0a53f..9eb9871bb21 100644 --- a/src/libsyntax/util/small_vector.rs +++ b/src/libsyntax/util/small_vector.rs @@ -7,8 +7,10 @@ // , at your // option. This file may not be copied, modified, or distributed // except according to those terms. + use std::mem; -use std::vec; +use std::vec_ng::Vec; +use std::vec_ng; /// A vector type optimized for cases where the size is almost always 0 or 1 pub enum SmallVector { @@ -73,7 +75,7 @@ impl SmallVector { pub fn get<'a>(&'a self, idx: uint) -> &'a T { match *self { One(ref v) if idx == 0 => v, - Many(ref vs) => &vs[idx], + Many(ref vs) => vs.get(idx), _ => fail!("out of bounds access") } } @@ -104,7 +106,7 @@ impl SmallVector { pub enum MoveItems { priv ZeroIterator, priv OneIterator(T), - priv ManyIterator(vec::MoveItems), + priv ManyIterator(vec_ng::MoveItems), } impl Iterator for MoveItems { @@ -136,6 +138,8 @@ impl Iterator for MoveItems { mod test { use super::*; + use std::vec_ng::Vec; + #[test] fn test_len() { let v: SmallVector = SmallVector::zero(); -- cgit 1.4.1-3-g733a5