diff options
| author | ljedrz <ljedrz@gmail.com> | 2018-08-30 11:42:16 +0200 |
|---|---|---|
| committer | ljedrz <ljedrz@gmail.com> | 2018-09-26 10:43:37 +0200 |
| commit | 130a32fa7259d348dc3a684b38e688da398c30bb (patch) | |
| tree | fdac0e731215a273252f93254690a37d2c77fc25 /src/librustc_allocator | |
| parent | beff387601fef141e7b6716a6cd50728d079a0c1 (diff) | |
Remove OneVector
Diffstat (limited to 'src/librustc_allocator')
| -rw-r--r-- | src/librustc_allocator/expand.rs | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/librustc_allocator/expand.rs b/src/librustc_allocator/expand.rs index 11e8c30760b..5df68d49af5 100644 --- a/src/librustc_allocator/expand.rs +++ b/src/librustc_allocator/expand.rs @@ -9,8 +9,8 @@ // except according to those terms. use rustc::middle::allocator::AllocatorKind; -use rustc_data_structures::small_vec::OneVector; use rustc_errors; +use smallvec::SmallVec; use syntax::{ ast::{ self, Arg, Attribute, Crate, Expr, FnHeader, Generics, Ident, Item, ItemKind, @@ -65,7 +65,7 @@ struct ExpandAllocatorDirectives<'a> { } impl<'a> Folder for ExpandAllocatorDirectives<'a> { - fn fold_item(&mut self, item: P<Item>) -> OneVector<P<Item>> { + fn fold_item(&mut self, item: P<Item>) -> SmallVec<[P<Item>; 1]> { debug!("in submodule {}", self.in_submod); let name = if attr::contains_name(&item.attrs, "global_allocator") { @@ -152,11 +152,7 @@ impl<'a> Folder for ExpandAllocatorDirectives<'a> { let module = f.cx.monotonic_expander().fold_item(module).pop().unwrap(); // Return the item and new submodule - let mut ret = OneVector::with_capacity(2); - ret.push(item); - ret.push(module); - - return ret; + smallvec![item, module] } // If we enter a submodule, take note. |
