From 5e4b97e5897d4851845fd49b14f7fbc86226a278 Mon Sep 17 00:00:00 2001 From: Henrique Nogara Date: Mon, 27 Aug 2018 18:59:16 -0300 Subject: [PATCH] Closes #197 (#198) --- examples/concurrency.rs | 2 +- examples/pubsub.rs | 2 +- examples/readme_errors.rs | 2 +- examples/readme_futures.rs | 2 +- examples/readme_sync.rs | 2 +- examples/server_calling_server.rs | 2 +- examples/sync_server_calling_server.rs | 2 +- examples/throughput.rs | 2 +- examples/two_clients.rs | 2 +- src/lib.rs | 2 +- src/plugins/src/lib.rs | 9 +++++---- 11 files changed, 15 insertions(+), 14 deletions(-) diff --git a/examples/concurrency.rs b/examples/concurrency.rs index 67b1c79..705da39 100644 --- a/examples/concurrency.rs +++ b/examples/concurrency.rs @@ -3,7 +3,7 @@ // Licensed under the MIT License, . // 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; diff --git a/examples/pubsub.rs b/examples/pubsub.rs index c2d2dca..848c809 100644 --- a/examples/pubsub.rs +++ b/examples/pubsub.rs @@ -3,7 +3,7 @@ // Licensed under the MIT License, . // 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; diff --git a/examples/readme_errors.rs b/examples/readme_errors.rs index 3565f52..cf76975 100644 --- a/examples/readme_errors.rs +++ b/examples/readme_errors.rs @@ -3,7 +3,7 @@ // Licensed under the MIT License, . // 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] diff --git a/examples/readme_futures.rs b/examples/readme_futures.rs index 925ddca..f206734 100644 --- a/examples/readme_futures.rs +++ b/examples/readme_futures.rs @@ -3,7 +3,7 @@ // Licensed under the MIT License, . // 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; diff --git a/examples/readme_sync.rs b/examples/readme_sync.rs index 646a009..0652a1c 100644 --- a/examples/readme_sync.rs +++ b/examples/readme_sync.rs @@ -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] diff --git a/examples/server_calling_server.rs b/examples/server_calling_server.rs index fb93c3a..f4d2cb5 100644 --- a/examples/server_calling_server.rs +++ b/examples/server_calling_server.rs @@ -3,7 +3,7 @@ // Licensed under the MIT License, . // 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; diff --git a/examples/sync_server_calling_server.rs b/examples/sync_server_calling_server.rs index 5c2c01d..7335852 100644 --- a/examples/sync_server_calling_server.rs +++ b/examples/sync_server_calling_server.rs @@ -3,7 +3,7 @@ // Licensed under the MIT License, . // 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; diff --git a/examples/throughput.rs b/examples/throughput.rs index bc7baa8..8b8d9ff 100644 --- a/examples/throughput.rs +++ b/examples/throughput.rs @@ -3,7 +3,7 @@ // Licensed under the MIT License, . // 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] diff --git a/examples/two_clients.rs b/examples/two_clients.rs index 5597323..b2a8d95 100644 --- a/examples/two_clients.rs +++ b/examples/two_clients.rs @@ -3,7 +3,7 @@ // Licensed under the MIT License, . // 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] diff --git a/src/lib.rs b/src/lib.rs index 869ec18..717426a 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -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; diff --git a/src/plugins/src/lib.rs b/src/plugins/src/lib.rs index 64bd2e5..cec4729 100644 --- a/src/plugins/src/lib.rs +++ b/src/plugins/src/lib.rs @@ -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 { 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 Box { @@ -101,7 +102,7 @@ fn impl_snake_to_camel(cx: &mut ExtCtxt, sp: Span, tts: &[TokenTree]) -> Box Box {