1
Fork 0

Use span_suggestions instead of multipart_suggestions.

This commit is contained in:
Mara Bos 2021-11-04 18:12:09 +01:00
parent 5a25751c1e
commit 09e4a75f29

View file

@ -227,14 +227,12 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
Ok(s) if s.ends_with('}') => "",
_ => ";",
};
err.multipart_suggestions(
"try adding an expression at the end of the block",
return_suggestions.into_iter().map(|r| {
vec![(
err.span_suggestions(
span.shrink_to_hi(),
format!("{}\n{}{}", semicolon, indent, r),
)]
}),
"try adding an expression at the end of the block",
return_suggestions
.into_iter()
.map(|r| format!("{}\n{}{}", semicolon, indent, r)),
Applicability::MaybeIncorrect,
);
}