Diagnose unsorted CGUs.
An assertion failure was reported in #112946. This extra information will help diagnose the problem.
This commit is contained in:
parent
d9c13cd453
commit
fc8536669c
1 changed files with 7 additions and 1 deletions
|
@ -187,7 +187,13 @@ where
|
|||
}
|
||||
|
||||
// Ensure CGUs are sorted by name, so that we get deterministic results.
|
||||
assert!(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| Some(a.name().as_str().cmp(b.name().as_str()))) {
|
||||
let mut names = String::new();
|
||||
for cgu in codegen_units.iter() {
|
||||
names += &format!("- {}\n", cgu.name());
|
||||
}
|
||||
bug!("unsorted CGUs:\n{names}");
|
||||
}
|
||||
|
||||
codegen_units
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue