Rollup merge of #119538 - nnethercote:cleanup-errors-5, r=compiler-errors
Cleanup error handlers: round 5 More rustc_errors cleanups. A sequel to https://github.com/rust-lang/rust/pull/119171. r? ````@compiler-errors````
This commit is contained in:
commit
f361b591ef
57 changed files with 369 additions and 464 deletions
|
@ -70,7 +70,7 @@ fn generic_arg_mismatch_err(
|
|||
Res::Err => {
|
||||
add_braces_suggestion(arg, &mut err);
|
||||
return err
|
||||
.set_primary_message("unresolved item provided when a constant was expected")
|
||||
.primary_message("unresolved item provided when a constant was expected")
|
||||
.emit();
|
||||
}
|
||||
Res::Def(DefKind::TyParam, src_def_id) => {
|
||||
|
|
|
@ -319,10 +319,10 @@ impl<'a, G: EmissionGuarantee> IntoDiagnostic<'a, G> for MissingTypeParams {
|
|||
#[track_caller]
|
||||
fn into_diagnostic(self, dcx: &'a DiagCtxt, level: Level) -> DiagnosticBuilder<'a, G> {
|
||||
let mut err = DiagnosticBuilder::new(dcx, level, fluent::hir_analysis_missing_type_params);
|
||||
err.set_span(self.span);
|
||||
err.span(self.span);
|
||||
err.code(error_code!(E0393));
|
||||
err.set_arg("parameterCount", self.missing_type_params.len());
|
||||
err.set_arg(
|
||||
err.arg("parameterCount", self.missing_type_params.len());
|
||||
err.arg(
|
||||
"parameters",
|
||||
self.missing_type_params
|
||||
.iter()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue