Move code around.
No point computing `warnings` and `errors` if we're going to return early before they're used.
This commit is contained in:
parent
2aac288c18
commit
a0f5431e23
1 changed files with 4 additions and 3 deletions
|
@ -981,6 +981,10 @@ impl DiagCtxt {
|
||||||
|
|
||||||
inner.emit_stashed_diagnostics();
|
inner.emit_stashed_diagnostics();
|
||||||
|
|
||||||
|
if inner.treat_err_as_bug() {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
let warnings = match inner.deduplicated_warn_count {
|
let warnings = match inner.deduplicated_warn_count {
|
||||||
0 => Cow::from(""),
|
0 => Cow::from(""),
|
||||||
1 => Cow::from("1 warning emitted"),
|
1 => Cow::from("1 warning emitted"),
|
||||||
|
@ -991,9 +995,6 @@ impl DiagCtxt {
|
||||||
1 => Cow::from("aborting due to 1 previous error"),
|
1 => Cow::from("aborting due to 1 previous error"),
|
||||||
count => Cow::from(format!("aborting due to {count} previous errors")),
|
count => Cow::from(format!("aborting due to {count} previous errors")),
|
||||||
};
|
};
|
||||||
if inner.treat_err_as_bug() {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
match (errors.len(), warnings.len()) {
|
match (errors.len(), warnings.len()) {
|
||||||
(0, 0) => return,
|
(0, 0) => return,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue