.span_to_snippet(trait_m.generics.span)
.ok()?;
- err.multipart_suggestion(
+ err.multipart_suggestion_with_applicability(
"try changing the `impl Trait` argument to a generic parameter",
vec![
// replace `impl Trait` with `T`
// of the generics, but it works for the common case
(generics_span, new_generics),
],
+ Applicability::Unspecified,
);
Some(())
})();
.span_to_snippet(bounds)
.ok()?;
- err.multipart_suggestion(
+ err.multipart_suggestion_with_applicability(
"try removing the generic parameter and using `impl Trait` instead",
vec![
// delete generic parameters
// replace param usage with `impl Trait`
(span, format!("impl {}", bounds)),
],
+ Applicability::Unspecified,
);
Some(())
})();
let expr_text = print::to_string(print::NO_ANN, |s| s.print_expr(expr));
let suggestions = compatible_variants.iter()
.map(|v| format!("{}({})", v, expr_text)).collect::<Vec<_>>();
- err.span_suggestions(expr.span,
+ err.span_suggestions_with_applicability(expr.span,
"try using a variant of the expected type",
- suggestions);
+ suggestions,
+ Applicability::Unspecified,
+ );
}
}
is_assign,
) {
(Ok(l), Ok(r), false) => {
- err.multipart_suggestion(msg, vec![
+ err.multipart_suggestion_with_applicability(msg, vec![
(lhs_expr.span, format!("{}.to_owned()", l)),
(rhs_expr.span, format!("&{}", r)),
- ]);
+ ],
+ Applicability::Unspecified,
+ );
}
_ => {
err.help(msg);
));
}
if suggestions.len() > 0 {
- diag.multipart_suggestion(
+ diag.multipart_suggestion_with_applicability(
"format specifiers use curly braces",
suggestions,
+ Applicability::Unspecified,
);
}
}};