1
Fork 0

Rename LintContext::emit_spanned_lint as LintContext::emit_span_lint.

This commit is contained in:
Nicholas Nethercote 2024-01-16 14:40:39 +11:00
parent c915e90f7e
commit 1881bfaa2b
27 changed files with 112 additions and 128 deletions

View file

@ -121,7 +121,7 @@ impl<'tcx> LateLintPass<'tcx> for NoopMethodCall {
let orig_ty = expr_ty.peel_refs();
if receiver_ty == expr_ty {
cx.emit_spanned_lint(
cx.emit_span_lint(
NOOP_METHOD_CALL,
span,
NoopMethodCallDiag { method: call.ident.name, orig_ty, trait_, label: span },
@ -131,12 +131,12 @@ impl<'tcx> LateLintPass<'tcx> for NoopMethodCall {
// If `type_of(x) == T` and `x.borrow()` is used to get `&T`,
// then that should be allowed
sym::noop_method_borrow => return,
sym::noop_method_clone => cx.emit_spanned_lint(
sym::noop_method_clone => cx.emit_span_lint(
SUSPICIOUS_DOUBLE_REF_OP,
span,
SuspiciousDoubleRefCloneDiag { ty: expr_ty },
),
sym::noop_method_deref => cx.emit_spanned_lint(
sym::noop_method_deref => cx.emit_span_lint(
SUSPICIOUS_DOUBLE_REF_OP,
span,
SuspiciousDoubleRefDerefDiag { ty: expr_ty },