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:
@@ -1647,7 +1647,8 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
|
||||
let msg = format!("{kind} `{name}` is private");
|
||||
let def_span = tcx.def_span(item);
|
||||
tcx.dcx()
|
||||
.struct_span_err_with_code(span, msg, rustc_errors::error_code!(E0624))
|
||||
.struct_span_err(span, msg)
|
||||
.code_mv(rustc_errors::error_code!(E0624))
|
||||
.span_label_mv(span, format!("private {kind}"))
|
||||
.span_label_mv(def_span, format!("{kind} defined here"))
|
||||
.emit();
|
||||
|
||||
Reference in New Issue
Block a user