mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-10 14:02:57 +00:00
Rollup merge of #113402 - nnethercote:diagnose-unsorted-CGUs, r=lqd
Diagnose unsorted CGUs. An assertion failure was reported in #112946. This extra information will help diagnose the problem. r? `@lqd`
This commit is contained in:
commit
a7532d9278
@ -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…
Reference in New Issue
Block a user