From 631871c553e16e020ea4161530b76d03b0c9bc3f Mon Sep 17 00:00:00 2001 From: Bastien Orivel Date: Tue, 29 May 2018 12:33:02 +0200 Subject: Update quote and proc-macro. I give up on the doc comments. This is a rebase of #1334 keeping the formatting of the comments and using TokenStream::from_str instead because one can hope. Fixes #1407. --- src/codegen/impl_debug.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/codegen/impl_debug.rs') diff --git a/src/codegen/impl_debug.rs b/src/codegen/impl_debug.rs index 8759bf27..d429e328 100644 --- a/src/codegen/impl_debug.rs +++ b/src/codegen/impl_debug.rs @@ -3,14 +3,14 @@ use ir::context::BindgenContext; use ir::derive::CanTriviallyDeriveDebug; use ir::item::{HasTypeParamInArray, IsOpaque, Item, ItemCanonicalName}; use ir::ty::{RUST_DERIVE_IN_ARRAY_LIMIT, TypeKind}; -use quote; +use proc_macro2; pub fn gen_debug_impl( ctx: &BindgenContext, fields: &[Field], item: &Item, kind: CompKind, -) -> quote::Tokens { +) -> proc_macro2::TokenStream { let struct_name = item.canonical_name(ctx); let mut format_string = format!("{} {{{{ ", struct_name); let mut tokens = vec![]; @@ -63,7 +63,7 @@ pub trait ImplDebug<'a> { &self, ctx: &BindgenContext, extra: Self::Extra, - ) -> Option<(String, Vec)>; + ) -> Option<(String, Vec)>; } impl<'a> ImplDebug<'a> for FieldData { @@ -73,7 +73,7 @@ impl<'a> ImplDebug<'a> for FieldData { &self, ctx: &BindgenContext, _: Self::Extra, - ) -> Option<(String, Vec)> { + ) -> Option<(String, Vec)> { if let Some(name) = self.name() { ctx.resolve_item(self.ty()).impl_debug(ctx, name) } else { @@ -89,7 +89,7 @@ impl<'a> ImplDebug<'a> for BitfieldUnit { &self, ctx: &BindgenContext, _: Self::Extra, - ) -> Option<(String, Vec)> { + ) -> Option<(String, Vec)> { let mut format_string = String::new(); let mut tokens = vec![]; for (i, bitfield) in self.bitfields().iter().enumerate() { @@ -118,7 +118,7 @@ impl<'a> ImplDebug<'a> for Item { &self, ctx: &BindgenContext, name: &str, - ) -> Option<(String, Vec)> { + ) -> Option<(String, Vec)> { let name_ident = ctx.rust_ident(name); // We don't know if blacklisted items `impl Debug` or not, so we can't @@ -136,8 +136,8 @@ impl<'a> ImplDebug<'a> for Item { fn debug_print( name: &str, - name_ident: quote::Tokens, - ) -> Option<(String, Vec)> { + name_ident: proc_macro2::TokenStream, + ) -> Option<(String, Vec)> { Some(( format!("{}: {{:?}}", name), vec![quote! { -- cgit v1.2.3