Rename struct_span_err! as struct_span_code_err!.

Because it takes an error code after the span. This avoids the confusing
overlap with the `DiagCtxt::struct_span_err` method, which doesn't take
an error code.
This commit is contained in:
Nicholas Nethercote
2024-01-04 09:08:36 +11:00
parent 99b1b0f85c
commit 4864cb8aef
46 changed files with 277 additions and 224 deletions

View File

@@ -1,7 +1,7 @@
use crate::dep_graph::dep_kinds;
use crate::query::plumbing::CyclePlaceholder;
use rustc_data_structures::fx::FxHashSet;
use rustc_errors::{pluralize, struct_span_err, Applicability, MultiSpan};
use rustc_errors::{pluralize, struct_span_code_err, Applicability, MultiSpan};
use rustc_hir as hir;
use rustc_hir::def::{DefKind, Res};
use rustc_middle::ty::Representability;
@@ -175,7 +175,7 @@ impl<'tcx, T> Value<TyCtxt<'tcx>> for Result<T, &'_ ty::layout::LayoutError<'_>>
} else {
tcx.def_span(def_id)
};
let mut diag = struct_span_err!(
let mut diag = struct_span_code_err!(
tcx.sess.dcx(),
span,
E0733,
@@ -309,7 +309,7 @@ pub fn recursive_type_error(
}
s
};
struct_span_err!(
struct_span_code_err!(
tcx.dcx(),
err_span,
E0072,