Skip to content

Commit

Permalink
fixup! Update compiler to use new is_sorted_by
Browse files Browse the repository at this point in the history
  • Loading branch information
EbbDrop committed Dec 16, 2023
1 parent 3e0f472 commit c2c00f5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions compiler/rustc_monomorphize/src/partitioning.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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| a.name().as_str() < 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());
Expand Down Expand Up @@ -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| a.name().as_str() < 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>> =
Expand Down

0 comments on commit c2c00f5

Please sign in to comment.