Use multispan suggestions more often

* Use more accurate span for `async move` suggestion
* Use more accurate span for deref suggestion
* Use `multipart_suggestion` more often
This commit is contained in:
Esteban Küber 2021-06-28 11:22:47 -07:00
parent 5fb3394cbd
commit 0b8f192cfe
61 changed files with 661 additions and 442 deletions

View file

@ -301,6 +301,20 @@ impl<'a> DiagnosticBuilder<'a> {
self
}
/// See [`Diagnostic::multipart_suggestions()`].
pub fn multipart_suggestions(
&mut self,
msg: &str,
suggestions: impl Iterator<Item = Vec<(Span, String)>>,
applicability: Applicability,
) -> &mut Self {
if !self.0.allow_suggestions {
return self;
}
self.0.diagnostic.multipart_suggestions(msg, suggestions, applicability);
self
}
/// See [`Diagnostic::span_suggestion_short()`].
pub fn span_suggestion_short(
&mut self,