Rename Session::span_diagnostic
as Session::dcx
.
This commit is contained in:
parent
9df1576e1d
commit
09af8a667c
66 changed files with 176 additions and 204 deletions
|
@ -1607,15 +1607,10 @@ fn check_method_receiver<'tcx>(
|
|||
}
|
||||
|
||||
fn e0307(tcx: TyCtxt<'_>, span: Span, receiver_ty: Ty<'_>) -> ErrorGuaranteed {
|
||||
struct_span_err!(
|
||||
tcx.sess.diagnostic(),
|
||||
span,
|
||||
E0307,
|
||||
"invalid `self` parameter type: {receiver_ty}"
|
||||
)
|
||||
.note("type of `self` must be `Self` or a type that dereferences to it")
|
||||
.help(HELP_FOR_SELF_TYPE)
|
||||
.emit()
|
||||
struct_span_err!(tcx.sess.dcx(), span, E0307, "invalid `self` parameter type: {receiver_ty}")
|
||||
.note("type of `self` must be `Self` or a type that dereferences to it")
|
||||
.help(HELP_FOR_SELF_TYPE)
|
||||
.emit()
|
||||
}
|
||||
|
||||
/// Returns whether `receiver_ty` would be considered a valid receiver type for `self_ty`. If
|
||||
|
|
|
@ -453,7 +453,7 @@ fn lint_auto_trait_impl<'tcx>(
|
|||
impl_def_id: LocalDefId,
|
||||
) {
|
||||
if trait_ref.args.len() != 1 {
|
||||
tcx.sess.diagnostic().span_delayed_bug(
|
||||
tcx.sess.dcx().span_delayed_bug(
|
||||
tcx.def_span(impl_def_id),
|
||||
"auto traits cannot have generic parameters",
|
||||
);
|
||||
|
|
|
@ -672,7 +672,7 @@ fn convert_trait_item(tcx: TyCtxt<'_>, trait_item_id: hir::TraitItemId) {
|
|||
|
||||
hir::TraitItemKind::Const(ty, body_id) => {
|
||||
tcx.ensure().type_of(def_id);
|
||||
if !tcx.sess.diagnostic().has_stashed_diagnostic(ty.span, StashKey::ItemNoType)
|
||||
if !tcx.sess.dcx().has_stashed_diagnostic(ty.span, StashKey::ItemNoType)
|
||||
&& !(is_suggestable_infer_ty(ty) && body_id.is_some())
|
||||
{
|
||||
// Account for `const C: _;`.
|
||||
|
|
|
@ -574,7 +574,7 @@ fn infer_placeholder_type<'a>(
|
|||
// then the user may have written e.g. `const A = 42;`.
|
||||
// In this case, the parser has stashed a diagnostic for
|
||||
// us to improve in typeck so we do that now.
|
||||
match tcx.sess.diagnostic().steal_diagnostic(span, StashKey::ItemNoType) {
|
||||
match tcx.sess.dcx().steal_diagnostic(span, StashKey::ItemNoType) {
|
||||
Some(mut err) => {
|
||||
if !ty.references_error() {
|
||||
// Only suggest adding `:` if it was missing (and suggested by parsing diagnostic)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue