Skip to content

Commit 86e0932

Browse files
authored
Unrolled build for #153051
Rollup merge of #153051 - GuillaumeGomez:migrate-diag, r=JonathanBrouwer Migration of `LintDiagnostic` - part 3 Follow-up of #152933 and of #153016. More `LintDiagnostic` items being migrated to `Diagnostic`. Since there is no remaining `emit_node_span_lint` calls, I replaced the method with the code of `emit_diag_node_span_lint`. r? @JonathanBrouwer
2 parents 11ad63a + 8fa1fca commit 86e0932

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+308
-282
lines changed

compiler/rustc_borrowck/src/lib.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2698,12 +2698,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, '_, 'tcx> {
26982698

26992699
let mut_span = tcx.sess.source_map().span_until_non_whitespace(span);
27002700

2701-
tcx.emit_diag_node_span_lint(
2702-
UNUSED_MUT,
2703-
lint_root,
2704-
span,
2705-
VarNeedNotMut { span: mut_span },
2706-
)
2701+
tcx.emit_node_span_lint(UNUSED_MUT, lint_root, span, VarNeedNotMut { span: mut_span })
27072702
}
27082703
}
27092704
}

compiler/rustc_codegen_ssa/src/target_features.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ pub(crate) fn from_target_feature_attr(
7575
// For "neon" specifically, we emit an FCW instead of a hard error.
7676
// See <https://github.com/rust-lang/rust/issues/134375>.
7777
if tcx.sess.target.arch == Arch::AArch64 && name.as_str() == "neon" {
78-
tcx.emit_diag_node_span_lint(
78+
tcx.emit_node_span_lint(
7979
AARCH64_SOFTFLOAT_NEON,
8080
tcx.local_def_id_to_hir_id(did),
8181
feature_span,

compiler/rustc_const_eval/src/const_eval/error.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,5 +256,5 @@ pub(super) fn lint<'tcx, L>(
256256
{
257257
let (span, frames) = get_span_and_frames(tcx, &machine.stack);
258258

259-
tcx.emit_diag_node_span_lint(lint, machine.best_lint_scope(*tcx), span, decorator(frames));
259+
tcx.emit_node_span_lint(lint, machine.best_lint_scope(*tcx), span, decorator(frames));
260260
}

compiler/rustc_const_eval/src/const_eval/machine.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -718,7 +718,7 @@ impl<'tcx> interpret::Machine<'tcx> for CompileTimeMachine<'tcx> {
718718
.level
719719
.is_error();
720720
let span = ecx.cur_span();
721-
ecx.tcx.emit_diag_node_span_lint(
721+
ecx.tcx.emit_node_span_lint(
722722
rustc_session::lint::builtin::LONG_RUNNING_CONST_EVAL,
723723
hir_id,
724724
span,

compiler/rustc_hir_analysis/src/check/check.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1256,7 +1256,7 @@ fn check_impl_items_against_trait<'tcx>(
12561256
}
12571257

12581258
if self_is_guaranteed_unsize_self && tcx.generics_require_sized_self(ty_trait_item.def_id) {
1259-
tcx.emit_diag_node_span_lint(
1259+
tcx.emit_node_span_lint(
12601260
rustc_lint_defs::builtin::DEAD_CODE,
12611261
tcx.local_def_id_to_hir_id(ty_impl_item.def_id.expect_local()),
12621262
tcx.def_span(ty_impl_item.def_id),

compiler/rustc_hir_analysis/src/check/compare_impl_item/refine.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ fn report_mismatched_rpitit_signature<'tcx>(
345345
with_no_trimmed_paths!(with_types_for_signature!(format!("{return_ty}")));
346346

347347
let span = unmatched_bound.unwrap_or(span);
348-
tcx.emit_diag_node_span_lint(
348+
tcx.emit_node_span_lint(
349349
if is_internal { REFINING_IMPL_TRAIT_INTERNAL } else { REFINING_IMPL_TRAIT_REACHABLE },
350350
tcx.local_def_id_to_hir_id(impl_m_def_id.expect_local()),
351351
span,
@@ -442,7 +442,7 @@ fn report_mismatched_rpitit_captures<'tcx>(
442442
.sort_by_cached_key(|arg| !matches!(arg.kind(), ty::GenericArgKind::Lifetime(_)));
443443
let suggestion = format!("use<{}>", trait_captured_args.iter().join(", "));
444444

445-
tcx.emit_diag_node_span_lint(
445+
tcx.emit_node_span_lint(
446446
if is_internal { REFINING_IMPL_TRAIT_INTERNAL } else { REFINING_IMPL_TRAIT_REACHABLE },
447447
tcx.local_def_id_to_hir_id(impl_opaque_def_id),
448448
use_bound_span,

compiler/rustc_hir_analysis/src/check/wfcheck.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -797,7 +797,7 @@ fn lint_item_shadowing_supertrait_item<'tcx>(tcx: TyCtxt<'tcx>, trait_item_def_i
797797
errors::SupertraitItemShadowee::Several { traits: traits.into(), spans: spans.into() }
798798
};
799799

800-
tcx.emit_diag_node_span_lint(
800+
tcx.emit_node_span_lint(
801801
SHADOWING_SUPERTRAIT_ITEMS,
802802
tcx.local_def_id_to_hir_id(trait_item_def_id),
803803
tcx.def_span(trait_item_def_id),
@@ -2458,7 +2458,7 @@ fn lint_redundant_lifetimes<'tcx>(
24582458
&& outlives_env.free_region_map().sub_free_regions(tcx, victim, candidate)
24592459
{
24602460
shadowed.insert(victim);
2461-
tcx.emit_diag_node_span_lint(
2461+
tcx.emit_node_span_lint(
24622462
rustc_lint_defs::builtin::REDUNDANT_LIFETIMES,
24632463
tcx.local_def_id_to_hir_id(def_id.expect_local()),
24642464
tcx.def_span(def_id),

compiler/rustc_hir_analysis/src/coherence/orphan.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -497,13 +497,13 @@ fn lint_uncovered_ty_params<'tcx>(
497497
let name = tcx.item_ident(param_def_id);
498498

499499
match local_ty {
500-
Some(local_type) => tcx.emit_diag_node_span_lint(
500+
Some(local_type) => tcx.emit_node_span_lint(
501501
UNCOVERED_PARAM_IN_PROJECTION,
502502
hir_id,
503503
span,
504504
errors::TyParamFirstLocalLint { span, note: (), param: name, local_type },
505505
),
506-
None => tcx.emit_diag_node_span_lint(
506+
None => tcx.emit_node_span_lint(
507507
UNCOVERED_PARAM_IN_PROJECTION,
508508
hir_id,
509509
span,

compiler/rustc_hir_analysis/src/hir_ty_lowering/dyn_trait.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
291291
// FIXME(mgca): Ideally we would generalize the name of this lint to sth. like
292292
// `unused_associated_item_bindings` since this can now also trigger on *const*
293293
// projections / assoc *const* bindings.
294-
tcx.emit_diag_node_span_lint(
294+
tcx.emit_node_span_lint(
295295
UNUSED_ASSOCIATED_TYPE_BOUNDS,
296296
hir_id,
297297
span,

compiler/rustc_hir_typeck/src/cast.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -687,7 +687,7 @@ impl<'a, 'tcx> CastCheck<'tcx> {
687687
};
688688
let expr_ty = fcx.resolve_vars_if_possible(self.expr_ty);
689689
let cast_ty = fcx.resolve_vars_if_possible(self.cast_ty);
690-
fcx.tcx.emit_diag_node_span_lint(
690+
fcx.tcx.emit_node_span_lint(
691691
lint,
692692
self.expr.hir_id,
693693
self.span,
@@ -1125,7 +1125,7 @@ impl<'a, 'tcx> CastCheck<'tcx> {
11251125
};
11261126

11271127
let lint = errors::LossyProvenancePtr2Int { expr_ty, cast_ty, sugg };
1128-
fcx.tcx.emit_diag_node_span_lint(
1128+
fcx.tcx.emit_node_span_lint(
11291129
lint::builtin::LOSSY_PROVENANCE_CASTS,
11301130
self.expr.hir_id,
11311131
self.span,
@@ -1141,7 +1141,7 @@ impl<'a, 'tcx> CastCheck<'tcx> {
11411141
let expr_ty = fcx.resolve_vars_if_possible(self.expr_ty);
11421142
let cast_ty = fcx.resolve_vars_if_possible(self.cast_ty);
11431143
let lint = errors::LossyProvenanceInt2Ptr { expr_ty, cast_ty, sugg };
1144-
fcx.tcx.emit_diag_node_span_lint(
1144+
fcx.tcx.emit_node_span_lint(
11451145
lint::builtin::FUZZY_PROVENANCE_CASTS,
11461146
self.expr.hir_id,
11471147
self.span,

0 commit comments

Comments
 (0)