Skip to content

Commit 98dd6c7

Browse files
committed
Rename buffer_lint_with_diagnostic to buffer_lint
1 parent c4f6502 commit 98dd6c7

File tree

28 files changed

+57
-57
lines changed

28 files changed

+57
-57
lines changed

compiler/rustc_ast_passes/src/ast_validation.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -765,7 +765,7 @@ impl<'a> AstValidator<'a> {
765765
.span_to_snippet(span)
766766
.is_ok_and(|snippet| !snippet.starts_with("#["))
767767
{
768-
self.lint_buffer.buffer_lint_with_diagnostic(
768+
self.lint_buffer.buffer_lint(
769769
MISSING_ABI,
770770
id,
771771
span,
@@ -1426,7 +1426,7 @@ impl<'a> Visitor<'a> for AstValidator<'a> {
14261426
Self::check_decl_no_pat(&sig.decl, |span, ident, mut_ident| {
14271427
if mut_ident && matches!(ctxt, FnCtxt::Assoc(_)) {
14281428
if let Some(ident) = ident {
1429-
self.lint_buffer.buffer_lint_with_diagnostic(
1429+
self.lint_buffer.buffer_lint(
14301430
PATTERNS_IN_FNS_WITHOUT_BODY,
14311431
id,
14321432
span,
@@ -1506,7 +1506,7 @@ impl<'a> Visitor<'a> for AstValidator<'a> {
15061506
Some((right, snippet))
15071507
}
15081508
};
1509-
self.lint_buffer.buffer_lint_with_diagnostic(
1509+
self.lint_buffer.buffer_lint(
15101510
DEPRECATED_WHERE_CLAUSE_LOCATION,
15111511
item.id,
15121512
err.span,

compiler/rustc_attr/src/builtin.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,7 @@ pub fn cfg_matches(
528528
try_gate_cfg(cfg.name, cfg.span, sess, features);
529529
match sess.psess.check_config.expecteds.get(&cfg.name) {
530530
Some(ExpectedValues::Some(values)) if !values.contains(&cfg.value) => {
531-
sess.psess.buffer_lint_with_diagnostic(
531+
sess.psess.buffer_lint(
532532
UNEXPECTED_CFGS,
533533
cfg.span,
534534
lint_node_id,
@@ -539,7 +539,7 @@ pub fn cfg_matches(
539539
);
540540
}
541541
None if sess.psess.check_config.exhaustive_names => {
542-
sess.psess.buffer_lint_with_diagnostic(
542+
sess.psess.buffer_lint(
543543
UNEXPECTED_CFGS,
544544
cfg.span,
545545
lint_node_id,

compiler/rustc_builtin_macros/src/asm.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -510,15 +510,15 @@ fn expand_preparsed_asm(
510510
};
511511

512512
if template_str.contains(".intel_syntax") {
513-
ecx.psess().buffer_lint_with_diagnostic(
513+
ecx.psess().buffer_lint(
514514
lint::builtin::BAD_ASM_STYLE,
515515
find_span(".intel_syntax"),
516516
ecx.current_expansion.lint_node_id,
517517
BuiltinLintDiag::AvoidUsingIntelSyntax,
518518
);
519519
}
520520
if template_str.contains(".att_syntax") {
521-
ecx.psess().buffer_lint_with_diagnostic(
521+
ecx.psess().buffer_lint(
522522
lint::builtin::BAD_ASM_STYLE,
523523
find_span(".att_syntax"),
524524
ecx.current_expansion.lint_node_id,

compiler/rustc_builtin_macros/src/deriving/generic/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1621,7 +1621,7 @@ impl<'a> TraitDef<'a> {
16211621
};
16221622

16231623
if let Some(ty) = exception {
1624-
cx.sess.psess.buffer_lint_with_diagnostic(
1624+
cx.sess.psess.buffer_lint(
16251625
BYTE_SLICE_IN_PACKED_STRUCT_WITH_DERIVE,
16261626
sp,
16271627
ast::CRATE_NODE_ID,

compiler/rustc_builtin_macros/src/source_util.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ pub(crate) fn expand_include<'cx>(
144144
fn make_expr(mut self: Box<ExpandInclude<'a>>) -> Option<P<ast::Expr>> {
145145
let expr = parse_expr(&mut self.p).ok()?;
146146
if self.p.token != token::Eof {
147-
self.p.psess.buffer_lint_with_diagnostic(
147+
self.p.psess.buffer_lint(
148148
INCOMPLETE_INCLUDE,
149149
self.p.token.span,
150150
self.node_id,

compiler/rustc_builtin_macros/src/test_harness.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ struct InnerItemLinter<'a> {
160160
impl<'a> Visitor<'a> for InnerItemLinter<'_> {
161161
fn visit_item(&mut self, i: &'a ast::Item) {
162162
if let Some(attr) = attr::find_by_name(&i.attrs, sym::rustc_test_marker) {
163-
self.sess.psess.buffer_lint_with_diagnostic(
163+
self.sess.psess.buffer_lint(
164164
UNNAMEABLE_TEST_ITEMS,
165165
attr.span,
166166
i.id,

compiler/rustc_builtin_macros/src/util.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ pub(crate) fn warn_on_duplicate_attribute(ecx: &ExtCtxt<'_>, item: &Annotatable,
4242
};
4343
if let Some(attrs) = attrs {
4444
if let Some(attr) = attr::find_by_name(attrs, name) {
45-
ecx.psess().buffer_lint_with_diagnostic(
45+
ecx.psess().buffer_lint(
4646
DUPLICATE_MACRO_ATTRIBUTES,
4747
attr.span,
4848
ecx.current_expansion.lint_node_id,

compiler/rustc_expand/src/base.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1364,7 +1364,7 @@ fn pretty_printing_compatibility_hack(item: &Item, sess: &Session) -> bool {
13641364
};
13651365

13661366
if crate_matches {
1367-
sess.psess.buffer_lint_with_diagnostic(
1367+
sess.psess.buffer_lint(
13681368
PROC_MACRO_BACK_COMPAT,
13691369
item.ident.span,
13701370
ast::CRATE_NODE_ID,

compiler/rustc_expand/src/config.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ impl<'a> StripUnconfigured<'a> {
258258

259259
// Lint on zero attributes in source.
260260
if expanded_attrs.is_empty() {
261-
self.sess.psess.buffer_lint_with_diagnostic(
261+
self.sess.psess.buffer_lint(
262262
rustc_lint_defs::builtin::UNUSED_ATTRIBUTES,
263263
attr.span,
264264
ast::CRATE_NODE_ID,
@@ -341,15 +341,15 @@ impl<'a> StripUnconfigured<'a> {
341341
item_span,
342342
);
343343
if attr.has_name(sym::crate_type) {
344-
self.sess.psess.buffer_lint_with_diagnostic(
344+
self.sess.psess.buffer_lint(
345345
rustc_lint_defs::builtin::DEPRECATED_CFG_ATTR_CRATE_TYPE_NAME,
346346
attr.span,
347347
ast::CRATE_NODE_ID,
348348
BuiltinLintDiag::CrateTypeInCfgAttr,
349349
);
350350
}
351351
if attr.has_name(sym::crate_name) {
352-
self.sess.psess.buffer_lint_with_diagnostic(
352+
self.sess.psess.buffer_lint(
353353
rustc_lint_defs::builtin::DEPRECATED_CFG_ATTR_CRATE_TYPE_NAME,
354354
attr.span,
355355
ast::CRATE_NODE_ID,

compiler/rustc_expand/src/expand.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1799,7 +1799,7 @@ impl<'a, 'b> InvocationCollector<'a, 'b> {
17991799
}
18001800

18011801
if attr.is_doc_comment() {
1802-
self.cx.sess.psess.buffer_lint_with_diagnostic(
1802+
self.cx.sess.psess.buffer_lint(
18031803
UNUSED_DOC_COMMENTS,
18041804
current_span,
18051805
self.cx.current_expansion.lint_node_id,
@@ -1810,7 +1810,7 @@ impl<'a, 'b> InvocationCollector<'a, 'b> {
18101810
// `#[cfg]` and `#[cfg_attr]` are special - they are
18111811
// eagerly evaluated.
18121812
if attr_name != sym::cfg && attr_name != sym::cfg_attr {
1813-
self.cx.sess.psess.buffer_lint_with_diagnostic(
1813+
self.cx.sess.psess.buffer_lint(
18141814
UNUSED_ATTRIBUTES,
18151815
attr.span,
18161816
self.cx.current_expansion.lint_node_id,

compiler/rustc_expand/src/mbe/macro_check.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ fn check_binders(
268268
// FIXME: Report this as a hard error eventually and remove equivalent errors from
269269
// `parse_tt_inner` and `nameize`. Until then the error may be reported twice, once
270270
// as a hard error and then once as a buffered lint.
271-
psess.buffer_lint_with_diagnostic(
271+
psess.buffer_lint(
272272
MISSING_FRAGMENT_SPECIFIER,
273273
span,
274274
node_id,
@@ -646,6 +646,6 @@ fn ops_is_prefix(
646646
fn buffer_lint(psess: &ParseSess, span: MultiSpan, node_id: NodeId, diag: BuiltinLintDiag) {
647647
// Macros loaded from other crates have dummy node ids.
648648
if node_id != DUMMY_NODE_ID {
649-
psess.buffer_lint_with_diagnostic(META_VARIABLE_MISUSE, span, node_id, diag);
649+
psess.buffer_lint(META_VARIABLE_MISUSE, span, node_id, diag);
650650
}
651651
}

compiler/rustc_expand/src/mbe/macro_rules.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ impl<'a> ParserAnyMacro<'a> {
7979
// but `m!()` is allowed in expression positions (cf. issue #34706).
8080
if kind == AstFragmentKind::Expr && parser.token == token::Semi {
8181
if is_local {
82-
parser.psess.buffer_lint_with_diagnostic(
82+
parser.psess.buffer_lint(
8383
SEMICOLON_IN_EXPRESSIONS_FROM_MACROS,
8484
parser.token.span,
8585
lint_node_id,
@@ -1153,7 +1153,7 @@ fn check_matcher_core<'tt>(
11531153
name,
11541154
Some(NonterminalKind::PatParam { inferred: false }),
11551155
));
1156-
sess.psess.buffer_lint_with_diagnostic(
1156+
sess.psess.buffer_lint(
11571157
RUST_2021_INCOMPATIBLE_OR_PATTERNS,
11581158
span,
11591159
ast::CRATE_NODE_ID,

compiler/rustc_interface/src/util.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ pub(crate) fn check_attr_crate_type(
404404
n,
405405
None,
406406
);
407-
lint_buffer.buffer_lint_with_diagnostic(
407+
lint_buffer.buffer_lint(
408408
lint::builtin::UNKNOWN_CRATE_TYPES,
409409
ast::CRATE_NODE_ID,
410410
span,

compiler/rustc_lint_defs/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -784,7 +784,7 @@ impl LintBuffer {
784784
self.map.swap_remove(&id).unwrap_or_default()
785785
}
786786

787-
pub fn buffer_lint_with_diagnostic(
787+
pub fn buffer_lint(
788788
&mut self,
789789
lint: &'static Lint,
790790
id: NodeId,

compiler/rustc_metadata/src/creader.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -974,7 +974,7 @@ impl<'a, 'tcx> CrateLoader<'a, 'tcx> {
974974
continue;
975975
}
976976

977-
self.sess.psess.buffer_lint_with_diagnostic(
977+
self.sess.psess.buffer_lint(
978978
lint::builtin::UNUSED_CRATE_DEPENDENCIES,
979979
span,
980980
ast::CRATE_NODE_ID,
@@ -1015,7 +1015,7 @@ impl<'a, 'tcx> CrateLoader<'a, 'tcx> {
10151015
// Make a point span rather than covering the whole file
10161016
let span = krate.spans.inner_span.shrink_to_lo();
10171017

1018-
self.sess.psess.buffer_lint_with_diagnostic(
1018+
self.sess.psess.buffer_lint(
10191019
lint::builtin::WASM_C_ABI,
10201020
span,
10211021
ast::CRATE_NODE_ID,

compiler/rustc_middle/src/middle/stability.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ pub fn early_report_macro_deprecation(
220220
path,
221221
since_kind: deprecated_since_kind(is_in_effect, depr.since.clone()),
222222
};
223-
lint_buffer.buffer_lint_with_diagnostic(deprecation_lint(is_in_effect), node_id, span, diag);
223+
lint_buffer.buffer_lint(deprecation_lint(is_in_effect), node_id, span, diag);
224224
}
225225

226226
fn late_report_deprecation(

compiler/rustc_parse/src/lexer/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ impl<'psess, 'src> StringReader<'psess, 'src> {
370370
let content = self.str_from(content_start);
371371
if contains_text_flow_control_chars(content) {
372372
let span = self.mk_sp(start, self.pos);
373-
self.psess.buffer_lint_with_diagnostic(
373+
self.psess.buffer_lint(
374374
TEXT_DIRECTION_CODEPOINT_IN_COMMENT,
375375
span,
376376
ast::CRATE_NODE_ID,
@@ -722,7 +722,7 @@ impl<'psess, 'src> StringReader<'psess, 'src> {
722722
self.dcx().emit_err(errors::UnknownPrefix { span: prefix_span, prefix, sugg });
723723
} else {
724724
// Before Rust 2021, only emit a lint for migration.
725-
self.psess.buffer_lint_with_diagnostic(
725+
self.psess.buffer_lint(
726726
RUST_2021_PREFIXES_INCOMPATIBLE_SYNTAX,
727727
prefix_span,
728728
ast::CRATE_NODE_ID,

compiler/rustc_parse/src/parser/expr.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1913,7 +1913,7 @@ impl<'a> Parser<'a> {
19131913
| ExprKind::Block(_, None)
19141914
)
19151915
{
1916-
self.psess.buffer_lint_with_diagnostic(
1916+
self.psess.buffer_lint(
19171917
BREAK_WITH_LABEL_AND_LOOP,
19181918
lo.to(expr.span),
19191919
ast::CRATE_NODE_ID,

compiler/rustc_parse/src/validate_attr.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ fn emit_malformed_attribute(
189189
suggestions.push(format!("#{inner}[{name} = \"{descr}\"]"));
190190
}
191191
if should_warn(name) {
192-
psess.buffer_lint_with_diagnostic(
192+
psess.buffer_lint(
193193
ILL_FORMED_ATTRIBUTE_INPUT,
194194
span,
195195
ast::CRATE_NODE_ID,

compiler/rustc_resolve/src/check_unused.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ impl<'a, 'b, 'tcx> UnusedImportCheckVisitor<'a, 'b, 'tcx> {
151151
// We do this in any edition.
152152
if warn_if_unused {
153153
if let Some(&span) = maybe_unused_extern_crates.get(&extern_crate.id) {
154-
self.r.lint_buffer.buffer_lint_with_diagnostic(
154+
self.r.lint_buffer.buffer_lint(
155155
UNUSED_EXTERN_CRATES,
156156
extern_crate.id,
157157
span,
@@ -203,7 +203,7 @@ impl<'a, 'b, 'tcx> UnusedImportCheckVisitor<'a, 'b, 'tcx> {
203203
.span
204204
.find_ancestor_inside(extern_crate.span)
205205
.unwrap_or(extern_crate.ident.span);
206-
self.r.lint_buffer.buffer_lint_with_diagnostic(
206+
self.r.lint_buffer.buffer_lint(
207207
UNUSED_EXTERN_CRATES,
208208
extern_crate.id,
209209
extern_crate.span,
@@ -388,7 +388,7 @@ impl Resolver<'_, '_> {
388388
{
389389
if let ImportKind::MacroUse { .. } = import.kind {
390390
if !import.span.is_dummy() {
391-
self.lint_buffer.buffer_lint_with_diagnostic(
391+
self.lint_buffer.buffer_lint(
392392
MACRO_USE_EXTERN_CRATE,
393393
import.root_id,
394394
import.span,
@@ -409,7 +409,7 @@ impl Resolver<'_, '_> {
409409
}
410410
}
411411
ImportKind::MacroUse { .. } => {
412-
self.lint_buffer.buffer_lint_with_diagnostic(
412+
self.lint_buffer.buffer_lint(
413413
UNUSED_IMPORTS,
414414
import.root_id,
415415
import.span,
@@ -477,7 +477,7 @@ impl Resolver<'_, '_> {
477477
}
478478
};
479479

480-
visitor.r.lint_buffer.buffer_lint_with_diagnostic(
480+
visitor.r.lint_buffer.buffer_lint(
481481
UNUSED_IMPORTS,
482482
unused.use_tree_id,
483483
ms,
@@ -533,7 +533,7 @@ impl Resolver<'_, '_> {
533533
continue;
534534
}
535535

536-
self.lint_buffer.buffer_lint_with_diagnostic(
536+
self.lint_buffer.buffer_lint(
537537
UNUSED_QUALIFICATIONS,
538538
unn_qua.node_id,
539539
unn_qua.path_span,

compiler/rustc_resolve/src/diagnostics.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
128128
self.report_with_use_injections(krate);
129129

130130
for &(span_use, span_def) in &self.macro_expanded_macro_export_errors {
131-
self.lint_buffer.buffer_lint_with_diagnostic(
131+
self.lint_buffer.buffer_lint(
132132
MACRO_EXPANDED_MACRO_EXPORTS_ACCESSED_BY_ABSOLUTE_PATHS,
133133
CRATE_NODE_ID,
134134
span_use,
@@ -142,7 +142,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
142142
let NameBindingKind::Import { import, .. } = ambiguity_error.b1.0.kind else {
143143
unreachable!()
144144
};
145-
self.lint_buffer.buffer_lint_with_diagnostic(
145+
self.lint_buffer.buffer_lint(
146146
AMBIGUOUS_GLOB_IMPORTS,
147147
import.root_id,
148148
ambiguity_error.ident.span,
@@ -522,7 +522,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
522522
}
523523

524524
let diag = BuiltinLintDiag::AbsPathWithModule(root_span);
525-
self.lint_buffer.buffer_lint_with_diagnostic(
525+
self.lint_buffer.buffer_lint(
526526
ABSOLUTE_PATHS_NOT_STARTING_WITH_CRATE,
527527
node_id,
528528
root_span,

compiler/rustc_resolve/src/ident.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
524524
match binding {
525525
Ok(binding) => {
526526
if let Some(lint_id) = derive_fallback_lint_id {
527-
this.lint_buffer.buffer_lint_with_diagnostic(
527+
this.lint_buffer.buffer_lint(
528528
PROC_MACRO_DERIVE_RESOLUTION_FALLBACK,
529529
lint_id,
530530
orig_ident.span,

compiler/rustc_resolve/src/imports.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -619,7 +619,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
619619
&& binding.res() != Res::Err
620620
&& exported_ambiguities.contains(&binding)
621621
{
622-
self.lint_buffer.buffer_lint_with_diagnostic(
622+
self.lint_buffer.buffer_lint(
623623
AMBIGUOUS_GLOB_REEXPORTS,
624624
import.root_id,
625625
import.root_span,
@@ -654,7 +654,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
654654
&& glob_binding.vis.is_public()
655655
&& !binding.vis.is_public()
656656
{
657-
self.lint_buffer.buffer_lint_with_diagnostic(
657+
self.lint_buffer.buffer_lint(
658658
HIDDEN_GLOB_REEXPORTS,
659659
binding_id,
660660
binding.span,
@@ -1013,7 +1013,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
10131013
&& !max_vis.is_at_least(import_vis, self.tcx)
10141014
{
10151015
let def_id = self.local_def_id(id);
1016-
self.lint_buffer.buffer_lint_with_diagnostic(
1016+
self.lint_buffer.buffer_lint(
10171017
UNUSED_IMPORTS,
10181018
id,
10191019
import.span,
@@ -1246,7 +1246,7 @@ impl<'a, 'tcx> Resolver<'a, 'tcx> {
12461246
if !any_successful_reexport {
12471247
let (ns, binding) = reexport_error.unwrap();
12481248
if pub_use_of_private_extern_crate_hack(import, binding) {
1249-
self.lint_buffer.buffer_lint_with_diagnostic(
1249+
self.lint_buffer.buffer_lint(
12501250
PUB_USE_OF_PRIVATE_EXTERN_CRATE,
12511251
import_id,
12521252
import.span,

0 commit comments

Comments
 (0)