1
Fork 0

auto merge of #13016 : huonw/rust/new-opt-vec, r=cmr

Replace syntax::opt_vec with syntax::owned_slice

The `owned_slice::OwnedSlice` is  `(*T, uint)` (i.e. a direct equivalent to DSTs `~[T]`).

This shaves two words off the old OptVec type; and also makes substituting in other implementations easy, by removing all the mutation methods. (And also everything that's very rarely/never used.)
This commit is contained in:
bors 2014-03-21 20:06:44 -07:00
commit f5357cf3ce
42 changed files with 369 additions and 451 deletions

View file

@ -18,7 +18,7 @@ use syntax::codemap::DUMMY_SP;
use syntax::codemap;
use syntax::fold::Folder;
use syntax::fold;
use syntax::opt_vec;
use syntax::owned_slice::OwnedSlice;
use syntax::parse::token::InternedString;
use syntax::parse::token;
use syntax::util::small_vector::SmallVector;
@ -156,12 +156,12 @@ impl<'a> fold::Folder for PreludeInjector<'a> {
ast::PathSegment {
identifier: token::str_to_ident("std"),
lifetimes: Vec::new(),
types: opt_vec::Empty,
types: OwnedSlice::empty(),
},
ast::PathSegment {
identifier: token::str_to_ident("prelude"),
lifetimes: Vec::new(),
types: opt_vec::Empty,
types: OwnedSlice::empty(),
}),
};