Rename DiagnosticExt as DiagExt.

This commit is contained in:
Nicholas Nethercote 2024-02-29 16:34:08 +11:00
parent dc37dddeb5
commit ec920ce096
3 changed files with 4 additions and 4 deletions

View File

@ -1,7 +1,7 @@
//! checks for `#[inline]` on trait methods without bodies
use clippy_utils::diagnostics::span_lint_and_then;
use clippy_utils::sugg::DiagnosticExt;
use clippy_utils::sugg::DiagExt;
use rustc_ast::ast::Attribute;
use rustc_errors::Applicability;
use rustc_hir::{TraitFn, TraitItem, TraitItemKind};

View File

@ -1,7 +1,7 @@
use clippy_utils::diagnostics::span_lint_hir_and_then;
use clippy_utils::return_ty;
use clippy_utils::source::snippet;
use clippy_utils::sugg::DiagnosticExt;
use clippy_utils::sugg::DiagExt;
use rustc_errors::Applicability;
use rustc_hir as hir;
use rustc_hir::HirIdSet;

View File

@ -685,7 +685,7 @@ fn indentation<T: LintContext>(cx: &T, span: Span) -> Option<String> {
}
/// Convenience extension trait for `Diag`.
pub trait DiagnosticExt<T: LintContext> {
pub trait DiagExt<T: LintContext> {
/// Suggests to add an attribute to an item.
///
/// Correctly handles indentation of the attribute and item.
@ -732,7 +732,7 @@ fn suggest_item_with_attr<D: Display + ?Sized>(
fn suggest_remove_item(&mut self, cx: &T, item: Span, msg: &str, applicability: Applicability);
}
impl<T: LintContext> DiagnosticExt<T> for rustc_errors::Diag<'_, ()> {
impl<T: LintContext> DiagExt<T> for rustc_errors::Diag<'_, ()> {
fn suggest_item_with_attr<D: Display + ?Sized>(
&mut self,
cx: &T,