1
Fork 0

Use bool instead of PartiolOrd in is_sorted_by

This commit is contained in:
EbbDrop 2023-12-10 23:29:11 +01:00
parent 7e452c123c
commit 606eeb84ad
6 changed files with 37 additions and 26 deletions

View file

@ -182,7 +182,7 @@ where
}
// Ensure CGUs are sorted by name, so that we get deterministic results.
if !codegen_units.is_sorted_by(|a, b| Some(a.name().as_str().cmp(b.name().as_str()))) {
if !codegen_units.is_sorted_by(|a, b| a.name().as_str() <= b.name().as_str()) {
let mut names = String::new();
for cgu in codegen_units.iter() {
names += &format!("- {}\n", cgu.name());
@ -311,7 +311,7 @@ fn merge_codegen_units<'tcx>(
assert!(cx.tcx.sess.codegen_units().as_usize() >= 1);
// A sorted order here ensures merging is deterministic.
assert!(codegen_units.is_sorted_by(|a, b| Some(a.name().as_str().cmp(b.name().as_str()))));
assert!(codegen_units.is_sorted_by(|a, b| a.name().as_str() <= b.name().as_str()));
// This map keeps track of what got merged into what.
let mut cgu_contents: FxHashMap<Symbol, Vec<Symbol>> =