add a suggestion about undeclared alloc module

This commit is contained in:
Takayuki Maeda
2021-11-03 01:44:01 +09:00
parent ff0e14829e
commit acb9f9ba38
4 changed files with 39 additions and 9 deletions

View File

@@ -420,6 +420,10 @@ impl<'a> Resolver<'a> {
err.span_label(span, label);
if let Some((suggestions, msg, applicability)) = suggestion {
if suggestions.is_empty() {
err.help(&msg);
return err;
}
err.multipart_suggestion(&msg, suggestions, applicability);
}