Skip to content

Commit 7434b9f

Browse files
committed
fixup lint name
1 parent 9c64bb1 commit 7434b9f

File tree

8 files changed

+14
-14
lines changed

8 files changed

+14
-14
lines changed

compiler/rustc_ast/src/visit.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ pub trait Visitor<'ast>: Sized {
246246
macro_rules! walk_list {
247247
($visitor: expr, $method: ident, $list: expr $(, $($extra_args: expr),* )?) => {
248248
{
249-
#[cfg_attr(not(bootstrap), allow(for_loop_over_fallibles))]
249+
#[cfg_attr(not(bootstrap), allow(for_loops_over_fallibles))]
250250
for elem in $list {
251251
$visitor.$method(elem $(, $($extra_args,)* )?)
252252
}

compiler/rustc_lint/src/for_loop_over_fallibles.rs renamed to compiler/rustc_lint/src/for_loops_over_fallibles.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ use rustc_span::{sym, Span};
1010
use rustc_trait_selection::traits::TraitEngineExt;
1111

1212
declare_lint! {
13-
/// The `for_loop_over_fallibles` lint checks for `for` loops over `Option` or `Result` values.
13+
/// The `for_loops_over_fallibles` lint checks for `for` loops over `Option` or `Result` values.
1414
///
1515
/// ### Example
1616
///
@@ -34,14 +34,14 @@ declare_lint! {
3434
/// The "intended" use of `IntoIterator` implementations for `Option` and `Result` is passing them to
3535
/// generic code that expects something implementing `IntoIterator`. For example using `.chain(option)`
3636
/// to optionally add a value to an iterator.
37-
pub FOR_LOOP_OVER_FALLIBLES,
37+
pub FOR_LOOPS_OVER_FALLIBLES,
3838
Warn,
3939
"for-looping over an `Option` or a `Result`, which is more clearly expressed as an `if let`"
4040
}
4141

42-
declare_lint_pass!(ForLoopOverFallibles => [FOR_LOOP_OVER_FALLIBLES]);
42+
declare_lint_pass!(ForLoopsOverFallibles => [FOR_LOOPS_OVER_FALLIBLES]);
4343

44-
impl<'tcx> LateLintPass<'tcx> for ForLoopOverFallibles {
44+
impl<'tcx> LateLintPass<'tcx> for ForLoopsOverFallibles {
4545
fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) {
4646
let Some((pat, arg)) = extract_for_loop(expr) else { return };
4747

@@ -59,7 +59,7 @@ impl<'tcx> LateLintPass<'tcx> for ForLoopOverFallibles {
5959
"for loop over {article} `{ty}`. This is more readably written as an `if let` statement",
6060
);
6161

62-
cx.struct_span_lint(FOR_LOOP_OVER_FALLIBLES, arg.span, |diag| {
62+
cx.struct_span_lint(FOR_LOOPS_OVER_FALLIBLES, arg.span, |diag| {
6363
let mut warn = diag.build(msg);
6464

6565
if let Some(recv) = extract_iterator_next_call(cx, arg)

compiler/rustc_lint/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ mod early;
5252
mod enum_intrinsics_non_enums;
5353
mod errors;
5454
mod expect;
55-
mod for_loop_over_fallibles;
55+
mod for_loops_over_fallibles;
5656
pub mod hidden_unicode_codepoints;
5757
mod internal;
5858
mod late;
@@ -87,7 +87,7 @@ use rustc_span::Span;
8787
use array_into_iter::ArrayIntoIter;
8888
use builtin::*;
8989
use enum_intrinsics_non_enums::EnumIntrinsicsNonEnums;
90-
use for_loop_over_fallibles::*;
90+
use for_loops_over_fallibles::*;
9191
use hidden_unicode_codepoints::*;
9292
use internal::*;
9393
use let_underscore::*;
@@ -190,7 +190,7 @@ macro_rules! late_lint_mod_passes {
190190
$macro!(
191191
$args,
192192
[
193-
ForLoopOverFallibles: ForLoopOverFallibles,
193+
ForLoopsOverFallibles: ForLoopsOverFallibles,
194194
HardwiredLints: HardwiredLints,
195195
ImproperCTypesDeclarations: ImproperCTypesDeclarations,
196196
ImproperCTypesDefinitions: ImproperCTypesDefinitions,

library/core/tests/option.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ fn test_get_resource() {
5757
}
5858

5959
#[test]
60-
#[cfg_attr(not(bootstrap), allow(for_loop_over_fallibles))]
60+
#[cfg_attr(not(bootstrap), allow(for_loops_over_fallibles))]
6161
fn test_option_dance() {
6262
let x = Some(());
6363
let mut y = Some(5);

src/test/ui/issues/issue-30371.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// run-pass
22
#![allow(unreachable_code)]
3-
#![allow(for_loop_over_fallibles)]
3+
#![allow(for_loops_over_fallibles)]
44
#![deny(unused_variables)]
55

66
fn main() {

src/test/ui/lint/for_loop_over_fallibles.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ warning: for loop over an `Option`. This is more readably written as an `if let`
44
LL | for _ in Some(1) {}
55
| ^^^^^^^
66
|
7-
= note: `#[warn(for_loop_over_fallibles)]` on by default
7+
= note: `#[warn(for_loops_over_fallibles)]` on by default
88
help: to check pattern in a loop use `while let`
99
|
1010
LL | while let Some(_) = Some(1) {}

src/tools/clippy/tests/ui/for_loop_unfixable.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
clippy::for_kv_map
99
)]
1010
#[allow(clippy::linkedlist, clippy::unnecessary_mut_passed, clippy::similar_names)]
11-
#[allow(for_loop_over_fallibles)]
11+
#[allow(for_loops_over_fallibles)]
1212
fn main() {
1313
let vec = vec![1, 2, 3, 4];
1414

src/tools/clippy/tests/ui/for_loops_over_fallibles.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#![warn(clippy::for_loops_over_fallibles)]
22
#![allow(clippy::uninlined_format_args)]
3-
#![allow(for_loop_over_fallibles)]
3+
#![allow(for_loops_over_fallibles)]
44

55
fn for_loops_over_fallibles() {
66
let option = Some(1);

0 commit comments

Comments
 (0)