diff options
| author | Laurențiu Nicola <lnicola@dend.ro> | 2023-06-13 08:50:27 +0300 |
|---|---|---|
| committer | Laurențiu Nicola <lnicola@dend.ro> | 2023-06-13 08:50:27 +0300 |
| commit | 0b441ca6a59ccf8bdc515b361944ba97408bd468 (patch) | |
| tree | 14c6f8369345295e1655244e968ed9a8f4ef6f81 | |
| parent | d567091f472a6c2b55262e25d092f1d43a7a4fae (diff) | |
| download | rust-0b441ca6a59ccf8bdc515b361944ba97408bd468.tar.gz rust-0b441ca6a59ccf8bdc515b361944ba97408bd468.zip | |
Use a more obscure hasher name in derive expansion
| -rw-r--r-- | crates/hir-def/src/macro_expansion_tests/builtin_derive_macro.rs | 10 | ||||
| -rw-r--r-- | 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 1a5ab19e1c2..f41f9719043 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<H: core::hash::Hasher>(&self , state: &mut H) { - core::mem::discriminant(self ).hash(state); + fn hash<H: core::hash::Hasher>(&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 976cd6a4dde..3d1e272b900 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<H: #krate::hash::Hasher>(&self, state: &mut H) { + fn hash<H: #krate::hash::Hasher>(&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<H: #krate::hash::Hasher>(&self, state: &mut H) { - #krate::mem::discriminant(self).hash(state); + fn hash<H: #krate::hash::Hasher>(&self, ra_expand_state: &mut H) { + #krate::mem::discriminant(self).hash(ra_expand_state); match self { ##arms } |
