Skip to content

Commit cdbae16

Browse files
committed
Use Ident for project
1 parent 74b6419 commit cdbae16

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/librustc_macros/src/hash_stable.rs

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
use synstructure;
22
use syn::{self, Meta, NestedMeta};
3-
use proc_macro2::{self, Ident, Span};
3+
use proc_macro2::{self, Ident};
44

55
struct Attributes {
66
ignore: bool,
7-
project: Option<String>,
7+
project: Option<Ident>,
88
}
99

1010
fn parse_attributes(field: &syn::Field) -> Attributes {
@@ -29,7 +29,7 @@ fn parse_attributes(field: &syn::Field) -> Attributes {
2929
if let Meta::List(list) = meta {
3030
if let Some(nested) = list.nested.iter().next() {
3131
if let NestedMeta::Meta(meta) = nested {
32-
attrs.project = Some(meta.name().to_string());
32+
attrs.project = Some(meta.name());
3333
any_attr = true;
3434
}
3535
}
@@ -55,7 +55,6 @@ pub fn hash_stable_derive(mut s: synstructure::Structure) -> proc_macro2::TokenS
5555
if attrs.ignore {
5656
quote!{}
5757
} else if let Some(project) = attrs.project {
58-
let project = Ident::new(&project, Span::call_site());
5958
quote!{
6059
&#bi.#project.hash_stable(__hcx, __hasher);
6160
}

0 commit comments

Comments
 (0)