Commit 15a7950
committed
Auto merge of #6105 - bugadani:sus-char, r=ebroto
Lint for invisible Unicode characters other than ZWSP
This PR extends the existing `zero_width_space` lint to look for other invisible characters as well (in this case, `\\u{ad}` soft hyphen.
I feel like this lint is the logical place to add the check, but I also realize the lint name is not particularly flexible, but I also understand that it shouldn't be renamed for compatibility reasons.
Open questions:
- What other characters should trigger the lint?
- What should be done with the lint name?
- How to indicate the change in functionality?
Motivation behind this PR: rust-lang/rust#77417 - I managed to shoot myself in the foot by an invisible character pasted into my test case.File tree
6 files changed
+47
-27
lines changed- clippy_lints/src
- src/lintlist
- tests/ui
6 files changed
+47
-27
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1647 | 1647 | | |
1648 | 1648 | | |
1649 | 1649 | | |
| 1650 | + | |
1650 | 1651 | | |
1651 | 1652 | | |
1652 | 1653 | | |
| |||
1922 | 1923 | | |
1923 | 1924 | | |
1924 | 1925 | | |
1925 | | - | |
1926 | 1926 | | |
1927 | 1927 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
854 | 854 | | |
855 | 855 | | |
856 | 856 | | |
| 857 | + | |
857 | 858 | | |
858 | 859 | | |
859 | | - | |
860 | 860 | | |
861 | 861 | | |
862 | 862 | | |
| |||
1511 | 1511 | | |
1512 | 1512 | | |
1513 | 1513 | | |
1514 | | - | |
| 1514 | + | |
1515 | 1515 | | |
1516 | 1516 | | |
1517 | 1517 | | |
| |||
1779 | 1779 | | |
1780 | 1780 | | |
1781 | 1781 | | |
1782 | | - | |
| 1782 | + | |
1783 | 1783 | | |
1784 | 1784 | | |
1785 | 1785 | | |
| |||
1910 | 1910 | | |
1911 | 1911 | | |
1912 | 1912 | | |
| 1913 | + | |
1913 | 1914 | | |
1914 | 1915 | | |
1915 | 1916 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
19 | | - | |
20 | | - | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| |||
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
66 | | - | |
| 66 | + | |
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
| |||
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
94 | | - | |
| 94 | + | |
95 | 95 | | |
96 | 96 | | |
97 | | - | |
| 97 | + | |
98 | 98 | | |
99 | | - | |
| 99 | + | |
100 | 100 | | |
101 | | - | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
102 | 105 | | |
103 | 106 | | |
104 | 107 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
969 | 969 | | |
970 | 970 | | |
971 | 971 | | |
| 972 | + | |
| 973 | + | |
| 974 | + | |
| 975 | + | |
| 976 | + | |
| 977 | + | |
| 978 | + | |
972 | 979 | | |
973 | 980 | | |
974 | 981 | | |
| |||
2810 | 2817 | | |
2811 | 2818 | | |
2812 | 2819 | | |
2813 | | - | |
2814 | | - | |
2815 | | - | |
2816 | | - | |
2817 | | - | |
2818 | | - | |
2819 | | - | |
2820 | 2820 | | |
2821 | 2821 | | |
2822 | 2822 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
5 | 9 | | |
6 | 10 | | |
7 | 11 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
8 | 20 | | |
9 | 21 | | |
10 | | - | |
| 22 | + | |
11 | 23 | | |
12 | 24 | | |
13 | 25 | | |
14 | 26 | | |
15 | 27 | | |
16 | 28 | | |
17 | 29 | | |
18 | | - | |
| 30 | + | |
19 | 31 | | |
20 | 32 | | |
21 | 33 | | |
22 | 34 | | |
23 | 35 | | |
24 | 36 | | |
25 | | - | |
| 37 | + | |
26 | 38 | | |
0 commit comments