about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2018-09-26 10:04:42 +0000
committerbors <bors@rust-lang.org>2018-09-26 10:04:42 +0000
commitc3a1a0d3400bbbcac194efb6ef2b14eef9be5149 (patch)
tree0a75f20d6c5a9def5008fd24194e83946f9ac9db /src/test
parenta2b27c19dad8b90063b56eff7b6433ba3f390d96 (diff)
parent130a32fa7259d348dc3a684b38e688da398c30bb (diff)
downloadrust-c3a1a0d3400bbbcac194efb6ef2b14eef9be5149.tar.gz
rust-c3a1a0d3400bbbcac194efb6ef2b14eef9be5149.zip
Auto merge of #53824 - ljedrz:begone_onevector, r=michaelwoerister
Remove OneVector, increase related SmallVec capacities

Removes the `OneVector` type alias (equivalent to `SmallVec<[T; 1]>`); it is used in scenarios where the capacity of 1 is often exceeded, which might be nullifying the performance wins (due to spilling to the heap) expected when using `SmallVec` instead of `Vec`.

The numbers I used in this PR are very rough estimates - it would probably be a good idea to adjust some/all of them, which is what this proposal is all about.

It might be a good idea to additionally create some local type aliases for the `SmallVec`s in the `Folder` trait, as they are repeated in quite a few spots; I'd be happy to apply this sort of adjustments.
Diffstat (limited to 'src/test')
-rw-r--r--src/test/run-pass-fulldeps/auxiliary/issue-16723.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/test/run-pass-fulldeps/auxiliary/issue-16723.rs b/src/test/run-pass-fulldeps/auxiliary/issue-16723.rs
index 533d0ac490c..7b7092c7e22 100644
--- a/src/test/run-pass-fulldeps/auxiliary/issue-16723.rs
+++ b/src/test/run-pass-fulldeps/auxiliary/issue-16723.rs
@@ -17,9 +17,10 @@ extern crate syntax;
 extern crate rustc;
 extern crate rustc_data_structures;
 extern crate rustc_plugin;
+#[macro_use] extern crate smallvec;
 extern crate syntax_pos;
 
-use rustc_data_structures::small_vec::OneVector;
+use smallvec::SmallVec;
 use syntax::ext::base::{ExtCtxt, MacResult, MacEager};
 use syntax::tokenstream;
 use rustc_plugin::Registry;
@@ -31,8 +32,8 @@ pub fn plugin_registrar(reg: &mut Registry) {
 
 fn expand(cx: &mut ExtCtxt, _: syntax_pos::Span, _: &[tokenstream::TokenTree])
           -> Box<MacResult+'static> {
-    MacEager::items(OneVector::from_vec(vec![
+    MacEager::items(smallvec![
         quote_item!(cx, struct Struct1;).unwrap(),
         quote_item!(cx, struct Struct2;).unwrap()
-    ]))
+    ])
 }