diff options
Diffstat (limited to 'src/codegen/impl_debug.rs')
-rw-r--r-- | src/codegen/impl_debug.rs | 16 |
1 files changed, 8 insertions, 8 deletions
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<quote::Tokens>)>; + ) -> Option<(String, Vec<proc_macro2::TokenStream>)>; } impl<'a> ImplDebug<'a> for FieldData { @@ -73,7 +73,7 @@ impl<'a> ImplDebug<'a> for FieldData { &self, ctx: &BindgenContext, _: Self::Extra, - ) -> Option<(String, Vec<quote::Tokens>)> { + ) -> Option<(String, Vec<proc_macro2::TokenStream>)> { 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<quote::Tokens>)> { + ) -> Option<(String, Vec<proc_macro2::TokenStream>)> { 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<quote::Tokens>)> { + ) -> Option<(String, Vec<proc_macro2::TokenStream>)> { 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<quote::Tokens>)> { + name_ident: proc_macro2::TokenStream, + ) -> Option<(String, Vec<proc_macro2::TokenStream>)> { Some(( format!("{}: {{:?}}", name), vec![quote! { |