peace of mind: be absolutely sure we don't try to emit a 0-part suggestion
This commit is contained in:
parent
b32a5331dc
commit
8dcdb3eb3c
1 changed files with 4 additions and 1 deletions
|
|
@ -1159,6 +1159,9 @@ impl Subdiagnostic for Rust2024IncompatiblePatSugg {
|
|||
};
|
||||
format!("make the implied reference pattern{plural_derefs}{and_modes} explicit")
|
||||
};
|
||||
diag.multipart_suggestion_verbose(msg, self.suggestion, applicability);
|
||||
// FIXME(dianne): for peace of mind, don't risk emitting a 0-part suggestion (that panics!)
|
||||
if !self.suggestion.is_empty() {
|
||||
diag.multipart_suggestion_verbose(msg, self.suggestion, applicability);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue