Skip to content

Commit 2061e0f

Browse files
committed
make cargo test pass + example
1 parent 3ac8aa6 commit 2061e0f

File tree

4 files changed

+110
-103
lines changed

4 files changed

+110
-103
lines changed

clippy_lints/src/single_char_idents.rs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,17 @@ declare_clippy_lint! {
1919
///
2020
/// ### Example
2121
/// ```rust,ignore
22-
/// for i in collection {
23-
/// let x = i.x;
22+
/// for m in movies {
23+
/// let title = m.t;
2424
/// }
2525
/// ```
26+
/// Use instead:
27+
/// ```rust,ignore
28+
/// for movie in movies {
29+
/// let title = movie.title;
30+
/// }
31+
/// ```
32+
/// ```
2633
#[clippy::version = "1.72.0"]
2734
pub SINGLE_CHAR_IDENTS,
2835
restriction,

tests/ui/single_letter_idents.rs renamed to tests/ui/single_char_idents.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//@aux-build:proc_macros.rs
22
#![allow(nonstandard_style, unused)]
3-
#![warn(clippy::single_letter_idents)]
3+
#![warn(clippy::single_char_idents)]
44

55
extern crate proc_macros;
66
use proc_macros::external;

tests/ui/single_char_idents.stderr

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
error: this ident comprises of a single char
2+
--> $DIR/single_char_idents.rs:9:8
3+
|
4+
LL | struct A {
5+
| ^
6+
|
7+
= note: `-D clippy::single-char-idents` implied by `-D warnings`
8+
9+
error: this ident comprises of a single char
10+
--> $DIR/single_char_idents.rs:10:5
11+
|
12+
LL | a: u32,
13+
| ^
14+
15+
error: this ident comprises of a single char
16+
--> $DIR/single_char_idents.rs:12:5
17+
|
18+
LL | A: u32,
19+
| ^
20+
21+
error: this ident comprises of a single char
22+
--> $DIR/single_char_idents.rs:13:5
23+
|
24+
LL | I: u32,
25+
| ^
26+
27+
error: this ident comprises of a single char
28+
--> $DIR/single_char_idents.rs:16:8
29+
|
30+
LL | struct B(u32);
31+
| ^
32+
33+
error: this ident comprises of a single char
34+
--> $DIR/single_char_idents.rs:20:6
35+
|
36+
LL | enum C {
37+
| ^
38+
39+
error: this ident comprises of a single char
40+
--> $DIR/single_char_idents.rs:21:5
41+
|
42+
LL | D,
43+
| ^
44+
45+
error: this ident comprises of a single char
46+
--> $DIR/single_char_idents.rs:22:5
47+
|
48+
LL | E,
49+
| ^
50+
51+
error: this ident comprises of a single char
52+
--> $DIR/single_char_idents.rs:23:5
53+
|
54+
LL | F,
55+
| ^
56+
57+
error: this ident comprises of a single char
58+
--> $DIR/single_char_idents.rs:31:5
59+
|
60+
LL | w: u32,
61+
| ^
62+
63+
error: this ident comprises of a single char
64+
--> $DIR/single_char_idents.rs:34:11
65+
|
66+
LL | struct AA<T, E>(T, E);
67+
| ^
68+
69+
error: this ident comprises of a single char
70+
--> $DIR/single_char_idents.rs:34:14
71+
|
72+
LL | struct AA<T, E>(T, E);
73+
| ^
74+
75+
error: this ident comprises of a single char
76+
--> $DIR/single_char_idents.rs:34:17
77+
|
78+
LL | struct AA<T, E>(T, E);
79+
| ^
80+
81+
error: this ident comprises of a single char
82+
--> $DIR/single_char_idents.rs:34:20
83+
|
84+
LL | struct AA<T, E>(T, E);
85+
| ^
86+
87+
error: this ident comprises of a single char
88+
--> $DIR/single_char_idents.rs:38:9
89+
|
90+
LL | let w = 1;
91+
| ^
92+
93+
error: this ident comprises of a single char
94+
--> $DIR/single_char_idents.rs:58:4
95+
|
96+
LL | fn b() {}
97+
| ^
98+
99+
error: aborting due to 16 previous errors
100+

tests/ui/single_letter_idents.stderr

Lines changed: 0 additions & 100 deletions
This file was deleted.

0 commit comments

Comments
 (0)