1
Fork 0

Move PartialOrd impl out of rustc

Rustdoc's ordering requirements are probably not relevant to the rest of
the compiler.
This commit is contained in:
Joshua Nelson 2020-10-11 11:11:33 -04:00
parent 85c0479e17
commit 96b0446b53
2 changed files with 6 additions and 20 deletions

View file

@ -1984,12 +1984,12 @@ fn item_module(w: &mut Buffer, cx: &Context, item: &clean::Item, items: &[clean:
}
let s1 = i1.stability.as_ref().map(|s| s.level);
let s2 = i2.stability.as_ref().map(|s| s.level);
match (s1, s2) {
(Some(a), Some(b)) => match a.partial_cmp(&b) {
Some(Ordering::Equal) | None => {}
Some(other) => return other,
},
_ => {}
if let (Some(a), Some(b)) = (s1, s2) {
match (a.is_stable(), b.is_stable()) {
(true, true) | (false, false) => {}
(false, true) => return Ordering::Less,
(true, false) => return Ordering::Greater,
}
}
let lhs = i1.name.as_ref().map_or("", |s| &**s);
let rhs = i2.name.as_ref().map_or("", |s| &**s);