This commit is contained in:
Henrique Nogara
2018-08-27 18:59:16 -03:00
committed by Tim
parent 9bd66b7e49
commit 5e4b97e589
11 changed files with 15 additions and 14 deletions

View File

@@ -3,7 +3,7 @@
// Licensed under the MIT License, <LICENSE or http://opensource.org/licenses/MIT>.
// This file may not be copied, modified, or distributed except according to those terms.
#![feature(plugin, never_type, use_extern_macros, proc_macro_path_invoc)]
#![feature(plugin, never_type)]
#![plugin(tarpc_plugins)]
extern crate chrono;

View File

@@ -3,7 +3,7 @@
// Licensed under the MIT License, <LICENSE or http://opensource.org/licenses/MIT>.
// This file may not be copied, modified, or distributed except according to those terms.
#![feature(plugin, use_extern_macros, proc_macro_path_invoc)]
#![feature(plugin)]
#![plugin(tarpc_plugins)]
extern crate env_logger;

View File

@@ -3,7 +3,7 @@
// Licensed under the MIT License, <LICENSE or http://opensource.org/licenses/MIT>.
// This file may not be copied, modified, or distributed except according to those terms.
#![feature(plugin, use_extern_macros, proc_macro_path_invoc)]
#![feature(plugin)]
#![plugin(tarpc_plugins)]
#[macro_use]

View File

@@ -3,7 +3,7 @@
// Licensed under the MIT License, <LICENSE or http://opensource.org/licenses/MIT>.
// This file may not be copied, modified, or distributed except according to those terms.
#![feature(plugin, use_extern_macros, proc_macro_path_invoc)]
#![feature(plugin)]
#![plugin(tarpc_plugins)]
extern crate futures;

View File

@@ -4,7 +4,7 @@
// This file may not be copied, modified, or distributed except according to those terms.
// required by `FutureClient` (not used directly in this example)
#![feature(plugin, use_extern_macros, proc_macro_path_invoc)]
#![feature(plugin)]
#![plugin(tarpc_plugins)]
#[macro_use]

View File

@@ -3,7 +3,7 @@
// Licensed under the MIT License, <LICENSE or http://opensource.org/licenses/MIT>.
// This file may not be copied, modified, or distributed except according to those terms.
#![feature(plugin, use_extern_macros, proc_macro_path_invoc)]
#![feature(plugin)]
#![plugin(tarpc_plugins)]
extern crate env_logger;

View File

@@ -3,7 +3,7 @@
// Licensed under the MIT License, <LICENSE or http://opensource.org/licenses/MIT>.
// This file may not be copied, modified, or distributed except according to those terms.
#![feature(plugin, use_extern_macros, proc_macro_path_invoc)]
#![feature(plugin)]
#![plugin(tarpc_plugins)]
extern crate env_logger;

View File

@@ -3,7 +3,7 @@
// Licensed under the MIT License, <LICENSE or http://opensource.org/licenses/MIT>.
// This file may not be copied, modified, or distributed except according to those terms.
#![feature(plugin, use_extern_macros, proc_macro_path_invoc)]
#![feature(plugin)]
#![plugin(tarpc_plugins)]
#[macro_use]

View File

@@ -3,7 +3,7 @@
// Licensed under the MIT License, <LICENSE or http://opensource.org/licenses/MIT>.
// This file may not be copied, modified, or distributed except according to those terms.
#![feature(plugin, use_extern_macros, proc_macro_path_invoc)]
#![feature(plugin)]
#![plugin(tarpc_plugins)]
#[macro_use]

View File

@@ -116,7 +116,7 @@
#![deny(missing_docs, missing_debug_implementations)]
#![feature(never_type)]
#![cfg_attr(test, feature(plugin, use_extern_macros, proc_macro_path_invoc))]
#![cfg_attr(test, feature(plugin))]
#![cfg_attr(test, plugin(tarpc_plugins))]
extern crate byteorder;

View File

@@ -2,19 +2,20 @@
extern crate itertools;
extern crate rustc_plugin;
extern crate smallvec;
extern crate syntax;
use itertools::Itertools;
use rustc_plugin::Registry;
use smallvec::SmallVec;
use syntax::ast::{self, Ident, TraitRef, Ty, TyKind};
use syntax::ext::base::{ExtCtxt, MacResult, DummyResult, MacEager};
use syntax::codemap::Span;
use syntax::ext::quote::rt::Span;
use syntax::parse::{self, token, str_lit, PResult};
use syntax::parse::parser::{Parser, PathStyle};
use syntax::symbol::Symbol;
use syntax::ptr::P;
use syntax::tokenstream::{TokenTree, TokenStream};
use syntax::util::small_vector::SmallVector;
fn snake_to_camel(cx: &mut ExtCtxt, sp: Span, tts: &[TokenTree]) -> Box<MacResult + 'static> {
let mut parser = parse::new_parser_from_tts(cx.parse_sess(), tts.into());
@@ -79,7 +80,7 @@ fn snake_to_camel(cx: &mut ExtCtxt, sp: Span, tts: &[TokenTree]) -> Box<MacResul
.collect();
item.attrs.extend(attrs.into_iter());
MacEager::trait_items(SmallVector::one(item))
MacEager::trait_items(SmallVec::from_buf([item]))
}
fn impl_snake_to_camel(cx: &mut ExtCtxt, sp: Span, tts: &[TokenTree]) -> Box<MacResult + 'static> {
@@ -101,7 +102,7 @@ fn impl_snake_to_camel(cx: &mut ExtCtxt, sp: Span, tts: &[TokenTree]) -> Box<Mac
}
convert(&mut item.ident);
MacEager::impl_items(SmallVector::one(item))
MacEager::impl_items(SmallVec::from_buf([item]))
}
fn ty_snake_to_camel(cx: &mut ExtCtxt, sp: Span, tts: &[TokenTree]) -> Box<MacResult + 'static> {