Skip to content

Commit 3b5105c

Browse files
Fix derived HashStable impls
The author probably meant to call `hash_stable` on a reference to the field in question.
1 parent 0fdde0c commit 3b5105c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

compiler/rustc_macros/src/hash_stable.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ pub fn hash_stable_generic_derive(mut s: synstructure::Structure<'_>) -> proc_ma
5454
quote! {}
5555
} else if let Some(project) = attrs.project {
5656
quote! {
57-
&#bi.#project.hash_stable(__hcx, __hasher);
57+
(&#bi.#project).hash_stable(__hcx, __hasher);
5858
}
5959
} else {
6060
quote! {
@@ -95,7 +95,7 @@ pub fn hash_stable_derive(mut s: synstructure::Structure<'_>) -> proc_macro2::To
9595
quote! {}
9696
} else if let Some(project) = attrs.project {
9797
quote! {
98-
&#bi.#project.hash_stable(__hcx, __hasher);
98+
(&#bi.#project).hash_stable(__hcx, __hasher);
9999
}
100100
} else {
101101
quote! {

0 commit comments

Comments
 (0)