diff --git a/src/librustc_macros/src/hash_stable.rs b/src/librustc_macros/src/hash_stable.rs index 585f5505f1f..13899d68cd2 100644 --- a/src/librustc_macros/src/hash_stable.rs +++ b/src/librustc_macros/src/hash_stable.rs @@ -1,10 +1,10 @@ use synstructure; use syn::{self, Meta, NestedMeta}; -use proc_macro2::{self, Ident, Span}; +use proc_macro2::{self, Ident}; struct Attributes { ignore: bool, - project: Option, + project: Option, } fn parse_attributes(field: &syn::Field) -> Attributes { @@ -29,7 +29,7 @@ fn parse_attributes(field: &syn::Field) -> Attributes { if let Meta::List(list) = meta { if let Some(nested) = list.nested.iter().next() { if let NestedMeta::Meta(meta) = nested { - attrs.project = Some(meta.name().to_string()); + attrs.project = Some(meta.name()); any_attr = true; } } @@ -55,7 +55,6 @@ pub fn hash_stable_derive(mut s: synstructure::Structure) -> proc_macro2::TokenS if attrs.ignore { quote!{} } else if let Some(project) = attrs.project { - let project = Ident::new(&project, Span::call_site()); quote!{ &#bi.#project.hash_stable(__hcx, __hasher); }