mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-22 06:44:35 +00:00
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
@ -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