rename sum_with_parens

This commit is contained in:
Christian Poveda 2022-04-27 12:03:16 +02:00
parent 1e35bab104
commit e7ae9eb3f2
No known key found for this signature in database
GPG key ID: 27525EF5E7420A50

View file

@ -246,9 +246,9 @@ fn emit_many<G: EmissionGuarantee>(
#[derive(SessionDiagnostic)]
#[error(slug = "parser-maybe-report-ambiguous-plus")]
struct AmbiguousPlus {
pub sum_with_parens: String,
pub sum_ty: String,
#[primary_span]
#[suggestion(code = "({sum_with_parens})")]
#[suggestion(code = "({sum_ty})")]
pub span: Span,
}
@ -1182,10 +1182,7 @@ pub(super) fn maybe_report_ambiguous_plus(
ty: &Ty,
) {
if matches!(allow_plus, AllowPlus::No) && impl_dyn_multi {
self.sess.emit_err(AmbiguousPlus {
sum_with_parens: pprust::ty_to_string(&ty),
span: ty.span,
});
self.sess.emit_err(AmbiguousPlus { sum_ty: pprust::ty_to_string(&ty), span: ty.span });
}
}