mirror of
https://github.com/OMGeeky/tarpc.git
synced 2026-01-07 20:12:28 +01:00
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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]
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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]
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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]
|
||||
|
||||
@@ -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]
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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> {
|
||||
|
||||
Reference in New Issue
Block a user