Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-expand/src/proc_macro.rs')
| -rw-r--r-- | crates/hir-expand/src/proc_macro.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/crates/hir-expand/src/proc_macro.rs b/crates/hir-expand/src/proc_macro.rs index 9dcd5ef1ef..ceb6972a50 100644 --- a/crates/hir-expand/src/proc_macro.rs +++ b/crates/hir-expand/src/proc_macro.rs @@ -78,8 +78,10 @@ impl ProcMacrosBuilder { if let Ok(proc_macros) = &mut proc_macro { // Sort proc macros to improve incrementality when only their order has changed (ideally the build system // will not change their order, but just to be sure). - proc_macros - .sort_unstable_by_key(|proc_macro| (proc_macro.name.clone(), proc_macro.kind)); + proc_macros.sort_unstable_by(|proc_macro, proc_macro2| { + (proc_macro.name.as_str(), proc_macro.kind) + .cmp(&(proc_macro2.name.as_str(), proc_macro2.kind)) + }); } self.0.insert( proc_macros_crate, |