Update to proc-macro2 0.4

This commit is contained in:
David Tolnay
2018-05-20 19:34:52 -07:00
parent 656ea96c65
commit 3d5141a2f1
10 changed files with 168 additions and 169 deletions
+3 -4
View File
@@ -1,13 +1,12 @@
use proc_macro2::{Op, Spacing};
use quote::Tokens;
use proc_macro2::{Punct, Spacing, TokenStream};
// None of our generated code requires the `From::from` error conversion
// performed by the standard library's `try!` macro. With this simplified macro
// we see a significant improvement in type checking and borrow checking time of
// the generated code and a slight improvement in binary size.
pub fn replacement() -> Tokens {
pub fn replacement() -> TokenStream {
// Cannot pass `$expr` to `quote!` prior to Rust 1.17.0 so interpolate it.
let dollar = Op::new('$', Spacing::Alone);
let dollar = Punct::new('$', Spacing::Alone);
quote! {
#[allow(unused_macros)]