summaryrefslogtreecommitdiff
path: root/src/codegen/impl_partialeq.rs
diff options
context:
space:
mode:
authorBastien Orivel <eijebong@bananium.fr>2018-05-29 12:33:02 +0200
committerEmilio Cobos Álvarez <emilio@crisal.io>2018-11-30 06:25:53 +0100
commit631871c553e16e020ea4161530b76d03b0c9bc3f (patch)
treebc724aba974a6abf0befb5f36643d649a2bc0330 /src/codegen/impl_partialeq.rs
parent33912cfcdc34bda21599de29cd7b4241eb7c341a (diff)
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.
Diffstat (limited to 'src/codegen/impl_partialeq.rs')
-rw-r--r--src/codegen/impl_partialeq.rs9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/codegen/impl_partialeq.rs b/src/codegen/impl_partialeq.rs
index c8ff6313..ca61b4bf 100644
--- a/src/codegen/impl_partialeq.rs
+++ b/src/codegen/impl_partialeq.rs
@@ -3,7 +3,6 @@ use ir::comp::{CompInfo, CompKind, Field, FieldMethods};
use ir::context::BindgenContext;
use ir::item::{IsOpaque, Item};
use ir::ty::{TypeKind, RUST_DERIVE_IN_ARRAY_LIMIT};
-use quote;
use proc_macro2;
/// Generate a manual implementation of `PartialEq` trait for the
@@ -12,8 +11,8 @@ pub fn gen_partialeq_impl(
ctx: &BindgenContext,
comp_info: &CompInfo,
item: &Item,
- ty_for_impl: &quote::Tokens,
-) -> Option<quote::Tokens> {
+ ty_for_impl: &proc_macro2::TokenStream,
+) -> Option<proc_macro2::TokenStream> {
let mut tokens = vec![];
if item.is_opaque(ctx, &()) {
@@ -71,8 +70,8 @@ pub fn gen_partialeq_impl(
})
}
-fn gen_field(ctx: &BindgenContext, ty_item: &Item, name: &str) -> quote::Tokens {
- fn quote_equals(name_ident: proc_macro2::Term) -> quote::Tokens {
+fn gen_field(ctx: &BindgenContext, ty_item: &Item, name: &str) -> proc_macro2::TokenStream {
+ fn quote_equals(name_ident: proc_macro2::Ident) -> proc_macro2::TokenStream {
quote! { self.#name_ident == other.#name_ident }
}