Rollup merge of #118811 - EbbDrop:is-sorted-by-bool, r=Mark-Simulacrum
Use `bool` instead of `PartiolOrd` as return value of the comparison closure in `{slice,Iteraotr}::is_sorted_by` Changes the function signature of the closure given to `{slice,Iteraotr}::is_sorted_by` to return a `bool` instead of a `PartiolOrd` as suggested by the libs-api team here: https://github.com/rust-lang/rust/issues/53485#issuecomment-1766411980. This means these functions now return true if the closure returns true for all the pairs of values.
This commit is contained in:
commit
e8d1c2ef9c
6 changed files with 37 additions and 26 deletions
|
@ -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());
|
||||
|
@ -317,7 +317,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>> =
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue