From 0b441ca6a59ccf8bdc515b361944ba97408bd468 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lauren=C8=9Biu=20Nicola?= Date: Tue, 13 Jun 2023 08:50:27 +0300 Subject: [PATCH] Use a more obscure hasher name in derive expansion --- .../src/macro_expansion_tests/builtin_derive_macro.rs | 10 +++++----- crates/hir-expand/src/builtin_derive_macro.rs | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/crates/hir-def/src/macro_expansion_tests/builtin_derive_macro.rs b/crates/hir-def/src/macro_expansion_tests/builtin_derive_macro.rs index 1a5ab19e1c..f41f971904 100644 --- a/crates/hir-def/src/macro_expansion_tests/builtin_derive_macro.rs +++ b/crates/hir-def/src/macro_expansion_tests/builtin_derive_macro.rs @@ -396,18 +396,18 @@ enum Command { } impl < > core::hash::Hash for Command< > where { - fn hash(&self , state: &mut H) { - core::mem::discriminant(self ).hash(state); + fn hash(&self , ra_expand_state: &mut H) { + core::mem::discriminant(self ).hash(ra_expand_state); match self { Command::Move { x: x, y: y, } => { - x.hash(state); - y.hash(state); + x.hash(ra_expand_state); + y.hash(ra_expand_state); } , Command::Do(f0, )=> { - f0.hash(state); + f0.hash(ra_expand_state); } , Command::Jump=> {} , diff --git a/crates/hir-expand/src/builtin_derive_macro.rs b/crates/hir-expand/src/builtin_derive_macro.rs index 976cd6a4dd..3d1e272b90 100644 --- a/crates/hir-expand/src/builtin_derive_macro.rs +++ b/crates/hir-expand/src/builtin_derive_macro.rs @@ -613,7 +613,7 @@ fn hash_expand( span: tt::TokenId::unspecified(), }; return quote! { - fn hash(&self, state: &mut H) { + fn hash(&self, ra_expand_state: &mut H) { match #star self {} } }; @@ -621,7 +621,7 @@ fn hash_expand( let arms = adt.shape.as_pattern(&adt.name).into_iter().zip(adt.shape.field_names()).map( |(pat, names)| { let expr = { - let it = names.iter().map(|x| quote! { #x . hash(state); }); + let it = names.iter().map(|x| quote! { #x . hash(ra_expand_state); }); quote! { { ##it } } @@ -633,8 +633,8 @@ fn hash_expand( }, ); quote! { - fn hash(&self, state: &mut H) { - #krate::mem::discriminant(self).hash(state); + fn hash(&self, ra_expand_state: &mut H) { + #krate::mem::discriminant(self).hash(ra_expand_state); match self { ##arms }