Rename buffer_lint_with_diagnostic to buffer_lint
This commit is contained in:
parent
c4f6502c6d
commit
98dd6c7e8f
28 changed files with 57 additions and 57 deletions
|
@ -151,7 +151,7 @@ impl<'a, 'b, 'tcx> UnusedImportCheckVisitor<'a, 'b, 'tcx> {
|
|||
// We do this in any edition.
|
||||
if warn_if_unused {
|
||||
if let Some(&span) = maybe_unused_extern_crates.get(&extern_crate.id) {
|
||||
self.r.lint_buffer.buffer_lint_with_diagnostic(
|
||||
self.r.lint_buffer.buffer_lint(
|
||||
UNUSED_EXTERN_CRATES,
|
||||
extern_crate.id,
|
||||
span,
|
||||
|
@ -203,7 +203,7 @@ impl<'a, 'b, 'tcx> UnusedImportCheckVisitor<'a, 'b, 'tcx> {
|
|||
.span
|
||||
.find_ancestor_inside(extern_crate.span)
|
||||
.unwrap_or(extern_crate.ident.span);
|
||||
self.r.lint_buffer.buffer_lint_with_diagnostic(
|
||||
self.r.lint_buffer.buffer_lint(
|
||||
UNUSED_EXTERN_CRATES,
|
||||
extern_crate.id,
|
||||
extern_crate.span,
|
||||
|
@ -388,7 +388,7 @@ impl Resolver<'_, '_> {
|
|||
{
|
||||
if let ImportKind::MacroUse { .. } = import.kind {
|
||||
if !import.span.is_dummy() {
|
||||
self.lint_buffer.buffer_lint_with_diagnostic(
|
||||
self.lint_buffer.buffer_lint(
|
||||
MACRO_USE_EXTERN_CRATE,
|
||||
import.root_id,
|
||||
import.span,
|
||||
|
@ -409,7 +409,7 @@ impl Resolver<'_, '_> {
|
|||
}
|
||||
}
|
||||
ImportKind::MacroUse { .. } => {
|
||||
self.lint_buffer.buffer_lint_with_diagnostic(
|
||||
self.lint_buffer.buffer_lint(
|
||||
UNUSED_IMPORTS,
|
||||
import.root_id,
|
||||
import.span,
|
||||
|
@ -477,7 +477,7 @@ impl Resolver<'_, '_> {
|
|||
}
|
||||
};
|
||||
|
||||
visitor.r.lint_buffer.buffer_lint_with_diagnostic(
|
||||
visitor.r.lint_buffer.buffer_lint(
|
||||
UNUSED_IMPORTS,
|
||||
unused.use_tree_id,
|
||||
ms,
|
||||
|
@ -533,7 +533,7 @@ impl Resolver<'_, '_> {
|
|||
continue;
|
||||
}
|
||||
|
||||
self.lint_buffer.buffer_lint_with_diagnostic(
|
||||
self.lint_buffer.buffer_lint(
|
||||
UNUSED_QUALIFICATIONS,
|
||||
unn_qua.node_id,
|
||||
unn_qua.path_span,
|
||||
|
|
|
@ -128,7 +128,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
|
|||
self.report_with_use_injections(krate);
|
||||
|
||||
for &(span_use, span_def) in &self.macro_expanded_macro_export_errors {
|
||||
self.lint_buffer.buffer_lint_with_diagnostic(
|
||||
self.lint_buffer.buffer_lint(
|
||||
MACRO_EXPANDED_MACRO_EXPORTS_ACCESSED_BY_ABSOLUTE_PATHS,
|
||||
CRATE_NODE_ID,
|
||||
span_use,
|
||||
|
@ -142,7 +142,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
|
|||
let NameBindingKind::Import { import, .. } = ambiguity_error.b1.0.kind else {
|
||||
unreachable!()
|
||||
};
|
||||
self.lint_buffer.buffer_lint_with_diagnostic(
|
||||
self.lint_buffer.buffer_lint(
|
||||
AMBIGUOUS_GLOB_IMPORTS,
|
||||
import.root_id,
|
||||
ambiguity_error.ident.span,
|
||||
|
@ -522,7 +522,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
|
|||
}
|
||||
|
||||
let diag = BuiltinLintDiag::AbsPathWithModule(root_span);
|
||||
self.lint_buffer.buffer_lint_with_diagnostic(
|
||||
self.lint_buffer.buffer_lint(
|
||||
ABSOLUTE_PATHS_NOT_STARTING_WITH_CRATE,
|
||||
node_id,
|
||||
root_span,
|
||||
|
|
|
@ -524,7 +524,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
|
|||
match binding {
|
||||
Ok(binding) => {
|
||||
if let Some(lint_id) = derive_fallback_lint_id {
|
||||
this.lint_buffer.buffer_lint_with_diagnostic(
|
||||
this.lint_buffer.buffer_lint(
|
||||
PROC_MACRO_DERIVE_RESOLUTION_FALLBACK,
|
||||
lint_id,
|
||||
orig_ident.span,
|
||||
|
|
|
@ -619,7 +619,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
|
|||
&& binding.res() != Res::Err
|
||||
&& exported_ambiguities.contains(&binding)
|
||||
{
|
||||
self.lint_buffer.buffer_lint_with_diagnostic(
|
||||
self.lint_buffer.buffer_lint(
|
||||
AMBIGUOUS_GLOB_REEXPORTS,
|
||||
import.root_id,
|
||||
import.root_span,
|
||||
|
@ -654,7 +654,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
|
|||
&& glob_binding.vis.is_public()
|
||||
&& !binding.vis.is_public()
|
||||
{
|
||||
self.lint_buffer.buffer_lint_with_diagnostic(
|
||||
self.lint_buffer.buffer_lint(
|
||||
HIDDEN_GLOB_REEXPORTS,
|
||||
binding_id,
|
||||
binding.span,
|
||||
|
@ -1013,7 +1013,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
|
|||
&& !max_vis.is_at_least(import_vis, self.tcx)
|
||||
{
|
||||
let def_id = self.local_def_id(id);
|
||||
self.lint_buffer.buffer_lint_with_diagnostic(
|
||||
self.lint_buffer.buffer_lint(
|
||||
UNUSED_IMPORTS,
|
||||
id,
|
||||
import.span,
|
||||
|
@ -1246,7 +1246,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
|
|||
if !any_successful_reexport {
|
||||
let (ns, binding) = reexport_error.unwrap();
|
||||
if pub_use_of_private_extern_crate_hack(import, binding) {
|
||||
self.lint_buffer.buffer_lint_with_diagnostic(
|
||||
self.lint_buffer.buffer_lint(
|
||||
PUB_USE_OF_PRIVATE_EXTERN_CRATE,
|
||||
import_id,
|
||||
import.span,
|
||||
|
|
|
@ -1675,7 +1675,7 @@ impl<'a: 'ast, 'b, 'ast, 'tcx> LateResolutionVisitor<'a, 'b, 'ast, 'tcx> {
|
|||
return;
|
||||
}
|
||||
LifetimeRibKind::AnonymousWarn(node_id) => {
|
||||
self.r.lint_buffer.buffer_lint_with_diagnostic(
|
||||
self.r.lint_buffer.buffer_lint(
|
||||
lint::builtin::ELIDED_LIFETIMES_IN_ASSOCIATED_CONSTANT,
|
||||
node_id,
|
||||
lifetime.ident.span,
|
||||
|
@ -1960,7 +1960,7 @@ impl<'a: 'ast, 'b, 'ast, 'tcx> LateResolutionVisitor<'a, 'b, 'ast, 'tcx> {
|
|||
}
|
||||
|
||||
if should_lint {
|
||||
self.r.lint_buffer.buffer_lint_with_diagnostic(
|
||||
self.r.lint_buffer.buffer_lint(
|
||||
lint::builtin::ELIDED_LIFETIMES_IN_PATHS,
|
||||
segment_id,
|
||||
elided_lifetime_span,
|
||||
|
@ -4815,7 +4815,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
|
|||
late_resolution_visitor.resolve_doc_links(&krate.attrs, MaybeExported::Ok(CRATE_NODE_ID));
|
||||
visit::walk_crate(&mut late_resolution_visitor, krate);
|
||||
for (id, span) in late_resolution_visitor.diag_metadata.unused_labels.iter() {
|
||||
self.lint_buffer.buffer_lint_with_diagnostic(
|
||||
self.lint_buffer.buffer_lint(
|
||||
lint::builtin::UNUSED_LABELS,
|
||||
*id,
|
||||
*span,
|
||||
|
|
|
@ -2651,7 +2651,7 @@ impl<'a: 'ast, 'ast, 'tcx> LateResolutionVisitor<'a, '_, 'ast, 'tcx> {
|
|||
let deletion_span =
|
||||
if param.bounds.is_empty() { deletion_span() } else { None };
|
||||
|
||||
self.r.lint_buffer.buffer_lint_with_diagnostic(
|
||||
self.r.lint_buffer.buffer_lint(
|
||||
lint::builtin::SINGLE_USE_LIFETIMES,
|
||||
param.id,
|
||||
param.ident.span,
|
||||
|
@ -2669,7 +2669,7 @@ impl<'a: 'ast, 'ast, 'tcx> LateResolutionVisitor<'a, '_, 'ast, 'tcx> {
|
|||
|
||||
// if the lifetime originates from expanded code, we won't be able to remove it #104432
|
||||
if deletion_span.is_some_and(|sp| !sp.in_derive_expansion()) {
|
||||
self.r.lint_buffer.buffer_lint_with_diagnostic(
|
||||
self.r.lint_buffer.buffer_lint(
|
||||
lint::builtin::UNUSED_LIFETIMES,
|
||||
param.id,
|
||||
param.ident.span,
|
||||
|
|
|
@ -1860,7 +1860,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
|
|||
}
|
||||
if let NameBindingKind::Import { import, binding } = used_binding.kind {
|
||||
if let ImportKind::MacroUse { warn_private: true } = import.kind {
|
||||
self.lint_buffer().buffer_lint_with_diagnostic(
|
||||
self.lint_buffer().buffer_lint(
|
||||
PRIVATE_MACRO_USE,
|
||||
import.root_id,
|
||||
ident.span,
|
||||
|
|
|
@ -311,7 +311,7 @@ impl<'a, 'tcx> ResolverExpand for Resolver<'a, 'tcx> {
|
|||
|
||||
fn check_unused_macros(&mut self) {
|
||||
for (_, &(node_id, ident)) in self.unused_macros.iter() {
|
||||
self.lint_buffer.buffer_lint_with_diagnostic(
|
||||
self.lint_buffer.buffer_lint(
|
||||
UNUSED_MACROS,
|
||||
node_id,
|
||||
ident.span,
|
||||
|
@ -324,7 +324,7 @@ impl<'a, 'tcx> ResolverExpand for Resolver<'a, 'tcx> {
|
|||
continue;
|
||||
}
|
||||
let node_id = self.def_id_to_node_id[def_id];
|
||||
self.lint_buffer.buffer_lint_with_diagnostic(
|
||||
self.lint_buffer.buffer_lint(
|
||||
UNUSED_MACRO_RULES,
|
||||
node_id,
|
||||
rule_span,
|
||||
|
@ -558,7 +558,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
|
|||
_ => unreachable!(),
|
||||
};
|
||||
if soft_custom_inner_attributes_gate {
|
||||
self.tcx.sess.psess.buffer_lint_with_diagnostic(
|
||||
self.tcx.sess.psess.buffer_lint(
|
||||
SOFT_UNSTABLE,
|
||||
path.span,
|
||||
node_id,
|
||||
|
@ -585,7 +585,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
|
|||
|
||||
let typo_name = distance.map(|_| sym::on_unimplemented);
|
||||
|
||||
self.tcx.sess.psess.buffer_lint_with_diagnostic(
|
||||
self.tcx.sess.psess.buffer_lint(
|
||||
UNKNOWN_OR_MALFORMED_DIAGNOSTIC_ATTRIBUTES,
|
||||
attribute.span(),
|
||||
node_id,
|
||||
|
@ -789,7 +789,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
|
|||
.invocation_parents
|
||||
.get(&parent_scope.expansion)
|
||||
.map_or(ast::CRATE_NODE_ID, |id| self.def_id_to_node_id[id.0]);
|
||||
self.lint_buffer.buffer_lint_with_diagnostic(
|
||||
self.lint_buffer.buffer_lint(
|
||||
LEGACY_DERIVE_HELPERS,
|
||||
node_id,
|
||||
ident.span,
|
||||
|
@ -843,7 +843,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
|
|||
if !is_allowed(feature) && !allowed_by_implication {
|
||||
let lint_buffer = &mut self.lint_buffer;
|
||||
let soft_handler = |lint, span, msg: String| {
|
||||
lint_buffer.buffer_lint_with_diagnostic(
|
||||
lint_buffer.buffer_lint(
|
||||
lint,
|
||||
node_id,
|
||||
span,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue