Rename BuiltinLintDiagnostics
as BuiltinLintDiag
.
Not the dropping of the trailing `s` -- this type describes a single diagnostic and its name should be singular.
This commit is contained in:
parent
d98ad0a181
commit
7aa0eea19c
23 changed files with 105 additions and 113 deletions
|
@ -35,7 +35,7 @@ use rustc_data_structures::unord::UnordSet;
|
|||
use rustc_errors::{pluralize, MultiSpan};
|
||||
use rustc_hir::def::{DefKind, Res};
|
||||
use rustc_session::lint::builtin::{MACRO_USE_EXTERN_CRATE, UNUSED_EXTERN_CRATES, UNUSED_IMPORTS};
|
||||
use rustc_session::lint::BuiltinLintDiagnostics;
|
||||
use rustc_session::lint::BuiltinLintDiag;
|
||||
use rustc_span::symbol::{kw, Ident};
|
||||
use rustc_span::{Span, DUMMY_SP};
|
||||
|
||||
|
@ -412,7 +412,7 @@ impl Resolver<'_, '_> {
|
|||
unused.use_tree_id,
|
||||
ms,
|
||||
msg,
|
||||
BuiltinLintDiagnostics::UnusedImports(fix_msg.into(), fixes, test_module_span),
|
||||
BuiltinLintDiag::UnusedImports(fix_msg.into(), fixes, test_module_span),
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -428,7 +428,7 @@ impl Resolver<'_, '_> {
|
|||
extern_crate.id,
|
||||
span,
|
||||
"unused extern crate",
|
||||
BuiltinLintDiagnostics::UnusedExternCrate {
|
||||
BuiltinLintDiag::UnusedExternCrate {
|
||||
removal_span: extern_crate.span_with_attributes,
|
||||
},
|
||||
);
|
||||
|
@ -481,7 +481,7 @@ impl Resolver<'_, '_> {
|
|||
extern_crate.id,
|
||||
extern_crate.span,
|
||||
"`extern crate` is not idiomatic in the new edition",
|
||||
BuiltinLintDiagnostics::ExternCrateNotIdiomatic { vis_span, ident_span },
|
||||
BuiltinLintDiag::ExternCrateNotIdiomatic { vis_span, ident_span },
|
||||
);
|
||||
}
|
||||
|
||||
|
|
|
@ -19,7 +19,7 @@ use rustc_middle::ty::TyCtxt;
|
|||
use rustc_session::lint::builtin::ABSOLUTE_PATHS_NOT_STARTING_WITH_CRATE;
|
||||
use rustc_session::lint::builtin::AMBIGUOUS_GLOB_IMPORTS;
|
||||
use rustc_session::lint::builtin::MACRO_EXPANDED_MACRO_EXPORTS_ACCESSED_BY_ABSOLUTE_PATHS;
|
||||
use rustc_session::lint::{AmbiguityErrorDiag, BuiltinLintDiagnostics};
|
||||
use rustc_session::lint::{AmbiguityErrorDiag, BuiltinLintDiag};
|
||||
use rustc_session::Session;
|
||||
use rustc_span::edit_distance::find_best_match_for_name;
|
||||
use rustc_span::edition::Edition;
|
||||
|
@ -138,7 +138,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
|
|||
CRATE_NODE_ID,
|
||||
span_use,
|
||||
msg,
|
||||
BuiltinLintDiagnostics::MacroExpandedMacroExportsAccessedByAbsolutePaths(span_def),
|
||||
BuiltinLintDiag::MacroExpandedMacroExportsAccessedByAbsolutePaths(span_def),
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -153,7 +153,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
|
|||
import.root_id,
|
||||
ambiguity_error.ident.span,
|
||||
diag.msg.to_string(),
|
||||
BuiltinLintDiagnostics::AmbiguousGlobImports { diag },
|
||||
BuiltinLintDiag::AmbiguousGlobImports { diag },
|
||||
);
|
||||
} else {
|
||||
let mut err = struct_span_code_err!(self.dcx(), diag.span, E0659, "{}", &diag.msg);
|
||||
|
@ -525,7 +525,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
|
|||
}
|
||||
}
|
||||
|
||||
let diag = BuiltinLintDiagnostics::AbsPathWithModule(root_span);
|
||||
let diag = BuiltinLintDiag::AbsPathWithModule(root_span);
|
||||
self.lint_buffer.buffer_lint_with_diagnostic(
|
||||
ABSOLUTE_PATHS_NOT_STARTING_WITH_CRATE,
|
||||
node_id,
|
||||
|
|
|
@ -4,7 +4,7 @@ use rustc_hir::def::{DefKind, Namespace, NonMacroAttrKind, PartialRes, PerNS};
|
|||
use rustc_middle::bug;
|
||||
use rustc_middle::ty;
|
||||
use rustc_session::lint::builtin::PROC_MACRO_DERIVE_RESOLUTION_FALLBACK;
|
||||
use rustc_session::lint::BuiltinLintDiagnostics;
|
||||
use rustc_session::lint::BuiltinLintDiag;
|
||||
use rustc_span::def_id::LocalDefId;
|
||||
use rustc_span::hygiene::{ExpnId, ExpnKind, LocalExpnId, MacroKind, SyntaxContext};
|
||||
use rustc_span::symbol::{kw, Ident};
|
||||
|
@ -530,7 +530,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
|
|||
ns.descr(),
|
||||
ident
|
||||
),
|
||||
BuiltinLintDiagnostics::ProcMacroDeriveResolutionFallback(
|
||||
BuiltinLintDiag::ProcMacroDeriveResolutionFallback(
|
||||
orig_ident.span,
|
||||
),
|
||||
);
|
||||
|
|
|
@ -27,7 +27,7 @@ use rustc_session::lint::builtin::{
|
|||
AMBIGUOUS_GLOB_REEXPORTS, HIDDEN_GLOB_REEXPORTS, PUB_USE_OF_PRIVATE_EXTERN_CRATE,
|
||||
UNUSED_IMPORTS,
|
||||
};
|
||||
use rustc_session::lint::BuiltinLintDiagnostics;
|
||||
use rustc_session::lint::BuiltinLintDiag;
|
||||
use rustc_span::edit_distance::find_best_match_for_name;
|
||||
use rustc_span::hygiene::LocalExpnId;
|
||||
use rustc_span::symbol::{kw, Ident, Symbol};
|
||||
|
@ -618,7 +618,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
|
|||
import.root_id,
|
||||
import.root_span,
|
||||
"ambiguous glob re-exports",
|
||||
BuiltinLintDiagnostics::AmbiguousGlobReexports {
|
||||
BuiltinLintDiag::AmbiguousGlobReexports {
|
||||
name: key.ident.to_string(),
|
||||
namespace: key.ns.descr().to_string(),
|
||||
first_reexport_span: import.root_span,
|
||||
|
@ -654,7 +654,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
|
|||
binding_id,
|
||||
binding.span,
|
||||
"private item shadows public glob re-export",
|
||||
BuiltinLintDiagnostics::HiddenGlobReexports {
|
||||
BuiltinLintDiag::HiddenGlobReexports {
|
||||
name: key.ident.name.to_string(),
|
||||
namespace: key.ns.descr().to_owned(),
|
||||
glob_reexport_span: glob_binding.span,
|
||||
|
@ -1006,7 +1006,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
|
|||
id,
|
||||
import.span,
|
||||
msg,
|
||||
BuiltinLintDiagnostics::RedundantImportVisibility {
|
||||
BuiltinLintDiag::RedundantImportVisibility {
|
||||
max_vis: max_vis.to_string(def_id, self.tcx),
|
||||
span: import.span,
|
||||
},
|
||||
|
@ -1373,7 +1373,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
|
|||
id,
|
||||
import.span,
|
||||
format!("the item `{source}` is imported redundantly"),
|
||||
BuiltinLintDiagnostics::RedundantImport(redundant_spans, source),
|
||||
BuiltinLintDiag::RedundantImport(redundant_spans, source),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1660,7 +1660,7 @@ impl<'a: 'ast, 'b, 'ast, 'tcx> LateResolutionVisitor<'a, 'b, 'ast, 'tcx> {
|
|||
node_id,
|
||||
lifetime.ident.span,
|
||||
msg,
|
||||
lint::BuiltinLintDiagnostics::AssociatedConstElidedLifetime {
|
||||
lint::BuiltinLintDiag::AssociatedConstElidedLifetime {
|
||||
elided,
|
||||
span: lifetime.ident.span,
|
||||
},
|
||||
|
@ -1950,7 +1950,7 @@ impl<'a: 'ast, 'b, 'ast, 'tcx> LateResolutionVisitor<'a, 'b, 'ast, 'tcx> {
|
|||
segment_id,
|
||||
elided_lifetime_span,
|
||||
"hidden lifetime parameters in types are deprecated",
|
||||
lint::BuiltinLintDiagnostics::ElidedLifetimesInPaths(
|
||||
lint::BuiltinLintDiag::ElidedLifetimesInPaths(
|
||||
expected_lifetimes,
|
||||
path_span,
|
||||
!segment.has_generic_args,
|
||||
|
@ -4176,7 +4176,7 @@ impl<'a: 'ast, 'b, 'ast, 'tcx> LateResolutionVisitor<'a, 'b, 'ast, 'tcx> {
|
|||
finalize.node_id,
|
||||
finalize.path_span,
|
||||
"unnecessary qualification",
|
||||
lint::BuiltinLintDiagnostics::UnusedQualifications {
|
||||
lint::BuiltinLintDiag::UnusedQualifications {
|
||||
removal_span: finalize.path_span.until(unqualified.ident.span),
|
||||
},
|
||||
);
|
||||
|
|
|
@ -2658,7 +2658,7 @@ impl<'a: 'ast, 'ast, 'tcx> LateResolutionVisitor<'a, '_, 'ast, 'tcx> {
|
|||
param.id,
|
||||
param.ident.span,
|
||||
format!("lifetime parameter `{}` only used once", param.ident),
|
||||
lint::BuiltinLintDiagnostics::SingleUseLifetime {
|
||||
lint::BuiltinLintDiag::SingleUseLifetime {
|
||||
param_span: param.ident.span,
|
||||
use_span: Some((use_span, elidable)),
|
||||
deletion_span,
|
||||
|
@ -2676,7 +2676,7 @@ impl<'a: 'ast, 'ast, 'tcx> LateResolutionVisitor<'a, '_, 'ast, 'tcx> {
|
|||
param.id,
|
||||
param.ident.span,
|
||||
format!("lifetime parameter `{}` never used", param.ident),
|
||||
lint::BuiltinLintDiagnostics::SingleUseLifetime {
|
||||
lint::BuiltinLintDiag::SingleUseLifetime {
|
||||
param_span: param.ident.span,
|
||||
use_span: None,
|
||||
deletion_span,
|
||||
|
|
|
@ -27,7 +27,7 @@ use rustc_middle::ty::{TyCtxt, Visibility};
|
|||
use rustc_session::lint::builtin::UNKNOWN_OR_MALFORMED_DIAGNOSTIC_ATTRIBUTES;
|
||||
use rustc_session::lint::builtin::{LEGACY_DERIVE_HELPERS, SOFT_UNSTABLE};
|
||||
use rustc_session::lint::builtin::{UNUSED_MACROS, UNUSED_MACRO_RULES};
|
||||
use rustc_session::lint::BuiltinLintDiagnostics;
|
||||
use rustc_session::lint::BuiltinLintDiag;
|
||||
use rustc_session::parse::feature_err;
|
||||
use rustc_span::edition::Edition;
|
||||
use rustc_span::hygiene::{self, ExpnData, ExpnKind, LocalExpnId};
|
||||
|
@ -810,7 +810,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
|
|||
node_id,
|
||||
ident.span,
|
||||
"derive helper attribute is used before it is introduced",
|
||||
BuiltinLintDiagnostics::LegacyDeriveHelpers(binding.span),
|
||||
BuiltinLintDiag::LegacyDeriveHelpers(binding.span),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue