diff options
| author | Igor Gutorov <igootorov@gmail.com> | 2018-08-13 22:15:16 +0300 |
|---|---|---|
| committer | Igor Gutorov <igootorov@gmail.com> | 2018-08-23 10:45:53 +0300 |
| commit | 4d81fe9243cc8372d3ad5a0eec3dd638578a3541 (patch) | |
| tree | f392a7f8c84c5c771588d993675ecb07338739db /src/libsyntax_ext | |
| parent | e73077e10603b3586828f2d3d067f804c2fc0a1f (diff) | |
| download | rust-4d81fe9243cc8372d3ad5a0eec3dd638578a3541.tar.gz rust-4d81fe9243cc8372d3ad5a0eec3dd638578a3541.zip | |
Use optimized SmallVec implementation
Diffstat (limited to 'src/libsyntax_ext')
| -rw-r--r-- | src/libsyntax_ext/Cargo.toml | 3 | ||||
| -rw-r--r-- | src/libsyntax_ext/global_asm.rs | 6 | ||||
| -rw-r--r-- | src/libsyntax_ext/lib.rs | 2 |
3 files changed, 6 insertions, 5 deletions
diff --git a/src/libsyntax_ext/Cargo.toml b/src/libsyntax_ext/Cargo.toml index 1676757d9b8..8dba34583be 100644 --- a/src/libsyntax_ext/Cargo.toml +++ b/src/libsyntax_ext/Cargo.toml @@ -15,4 +15,5 @@ rustc_errors = { path = "../librustc_errors" } syntax = { path = "../libsyntax" } syntax_pos = { path = "../libsyntax_pos" } rustc_data_structures = { path = "../librustc_data_structures" } -rustc_target = { path = "../librustc_target" } \ No newline at end of file +rustc_target = { path = "../librustc_target" } +smallvec = { version = "0.6.5", features = ["union"] } diff --git a/src/libsyntax_ext/global_asm.rs b/src/libsyntax_ext/global_asm.rs index 56f28d04e9d..1130a50537d 100644 --- a/src/libsyntax_ext/global_asm.rs +++ b/src/libsyntax_ext/global_asm.rs @@ -18,8 +18,6 @@ /// LLVM's `module asm "some assembly here"`. All of LLVM's caveats /// therefore apply. -use rustc_data_structures::small_vec::OneVector; - use syntax::ast; use syntax::source_map::respan; use syntax::ext::base; @@ -52,7 +50,7 @@ pub fn expand_global_asm<'cx>(cx: &'cx mut ExtCtxt, None => return DummyResult::any(sp), }; - MacEager::items(OneVector::one(P(ast::Item { + MacEager::items(smallvec![P(ast::Item { ident: ast::Ident::with_empty_ctxt(Symbol::intern("")), attrs: Vec::new(), id: ast::DUMMY_NODE_ID, @@ -63,5 +61,5 @@ pub fn expand_global_asm<'cx>(cx: &'cx mut ExtCtxt, vis: respan(sp.shrink_to_lo(), ast::VisibilityKind::Inherited), span: sp, tokens: None, - }))) + })]) } diff --git a/src/libsyntax_ext/lib.rs b/src/libsyntax_ext/lib.rs index 1ba4ab47425..790a42007fb 100644 --- a/src/libsyntax_ext/lib.rs +++ b/src/libsyntax_ext/lib.rs @@ -29,6 +29,8 @@ extern crate proc_macro; extern crate rustc_data_structures; extern crate rustc_errors as errors; extern crate rustc_target; +#[macro_use] +extern crate smallvec; mod diagnostics; |
