Skip to content

Commit a68616f

Browse files
committed
internal: Symbol is not PartialOrd
1 parent 98f346f commit a68616f

File tree

2 files changed

+5
-15
lines changed

2 files changed

+5
-15
lines changed

src/tools/rust-analyzer/crates/hir-expand/src/proc_macro.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -78,8 +78,10 @@ impl ProcMacrosBuilder {
7878
if let Ok(proc_macros) = &mut proc_macro {
7979
// Sort proc macros to improve incrementality when only their order has changed (ideally the build system
8080
// will not change their order, but just to be sure).
81-
proc_macros
82-
.sort_unstable_by_key(|proc_macro| (proc_macro.name.clone(), proc_macro.kind));
81+
proc_macros.sort_unstable_by(|proc_macro, proc_macro2| {
82+
(proc_macro.name.as_str(), proc_macro.kind)
83+
.cmp(&(proc_macro2.name.as_str(), proc_macro2.kind))
84+
});
8385
}
8486
self.0.insert(
8587
proc_macros_crate,

src/tools/rust-analyzer/crates/intern/src/symbol.rs

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -42,18 +42,6 @@ struct TaggedArcPtr {
4242
unsafe impl Send for TaggedArcPtr {}
4343
unsafe impl Sync for TaggedArcPtr {}
4444

45-
impl Ord for TaggedArcPtr {
46-
fn cmp(&self, other: &Self) -> std::cmp::Ordering {
47-
self.as_str().cmp(other.as_str())
48-
}
49-
}
50-
51-
impl PartialOrd for TaggedArcPtr {
52-
fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {
53-
Some(self.cmp(other))
54-
}
55-
}
56-
5745
impl TaggedArcPtr {
5846
const BOOL_BITS: usize = true as usize;
5947

@@ -125,7 +113,7 @@ impl TaggedArcPtr {
125113
}
126114
}
127115

128-
#[derive(PartialEq, Eq, Hash, PartialOrd, Ord)]
116+
#[derive(PartialEq, Eq, Hash)]
129117
pub struct Symbol {
130118
repr: TaggedArcPtr,
131119
}

0 commit comments

Comments
 (0)