1
Fork 0

Remove all eight DiagnosticBuilder::*_with_code methods.

These all have relatively low use, and can be perfectly emulated with
a simpler construction method combined with `code` or `code_mv`.
This commit is contained in:
Nicholas Nethercote 2024-01-03 21:50:36 +11:00
parent bd4e623485
commit 6682f243dc
14 changed files with 84 additions and 180 deletions

View file

@ -944,13 +944,13 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
trait_item_span,
trait_path,
} => {
self.dcx().struct_span_err_with_code(
self.dcx().struct_span_err(
span,
format!(
"item `{name}` is an associated {kind}, which doesn't match its trait `{trait_path}`",
),
code,
)
.code_mv(code)
.span_label_mv(span, "does not match trait")
.span_label_mv(trait_item_span, "item in trait")
}