mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-27 15:11:30 +00:00
Add test.
This commit is contained in:
parent
178f502970
commit
4a6f7abeeb
3 changed files with 26 additions and 12 deletions
|
@ -14,6 +14,12 @@ macro_rules! a {
|
|||
};
|
||||
}
|
||||
|
||||
macro_rules! b {
|
||||
() => {
|
||||
let _ = 'a'..'z';
|
||||
};
|
||||
}
|
||||
|
||||
fn main() {
|
||||
#[rustfmt::skip]
|
||||
{
|
||||
|
@ -31,6 +37,7 @@ fn main() {
|
|||
let _ = b'B'..b'Z';
|
||||
|
||||
let _ = a!()..='z';
|
||||
b!();
|
||||
|
||||
let _ = match 0u8 {
|
||||
b'a'..=b'z' if true => 1,
|
||||
|
|
|
@ -14,6 +14,12 @@ macro_rules! a {
|
|||
};
|
||||
}
|
||||
|
||||
macro_rules! b {
|
||||
() => {
|
||||
let _ = 'a'..'z';
|
||||
};
|
||||
}
|
||||
|
||||
fn main() {
|
||||
#[rustfmt::skip]
|
||||
{
|
||||
|
@ -31,6 +37,7 @@ fn main() {
|
|||
let _ = b'B'..b'Z';
|
||||
|
||||
let _ = a!()..'z';
|
||||
b!();
|
||||
|
||||
let _ = match 0u8 {
|
||||
b'a'..b'z' if true => 1,
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
error: almost complete ascii letter range
|
||||
--> $DIR/almost_complete_letter_range.rs:20:17
|
||||
--> $DIR/almost_complete_letter_range.rs:26:17
|
||||
|
|
||||
LL | let _ = ('a') ..'z';
|
||||
| ^^^^^^--^^^
|
||||
|
@ -9,7 +9,7 @@ LL | let _ = ('a') ..'z';
|
|||
= note: `-D clippy::almost-complete-letter-range` implied by `-D warnings`
|
||||
|
||||
error: almost complete ascii letter range
|
||||
--> $DIR/almost_complete_letter_range.rs:21:17
|
||||
--> $DIR/almost_complete_letter_range.rs:27:17
|
||||
|
|
||||
LL | let _ = 'A' .. ('Z');
|
||||
| ^^^^--^^^^^^
|
||||
|
@ -17,7 +17,7 @@ LL | let _ = 'A' .. ('Z');
|
|||
| help: use an inclusive range: `..=`
|
||||
|
||||
error: almost complete ascii letter range
|
||||
--> $DIR/almost_complete_letter_range.rs:27:13
|
||||
--> $DIR/almost_complete_letter_range.rs:33:13
|
||||
|
|
||||
LL | let _ = (b'a')..(b'z');
|
||||
| ^^^^^^--^^^^^^
|
||||
|
@ -25,7 +25,7 @@ LL | let _ = (b'a')..(b'z');
|
|||
| help: use an inclusive range: `..=`
|
||||
|
||||
error: almost complete ascii letter range
|
||||
--> $DIR/almost_complete_letter_range.rs:28:13
|
||||
--> $DIR/almost_complete_letter_range.rs:34:13
|
||||
|
|
||||
LL | let _ = b'A'..b'Z';
|
||||
| ^^^^--^^^^
|
||||
|
@ -33,7 +33,7 @@ LL | let _ = b'A'..b'Z';
|
|||
| help: use an inclusive range: `..=`
|
||||
|
||||
error: almost complete ascii letter range
|
||||
--> $DIR/almost_complete_letter_range.rs:33:13
|
||||
--> $DIR/almost_complete_letter_range.rs:39:13
|
||||
|
|
||||
LL | let _ = a!()..'z';
|
||||
| ^^^^--^^^
|
||||
|
@ -41,7 +41,7 @@ LL | let _ = a!()..'z';
|
|||
| help: use an inclusive range: `..=`
|
||||
|
||||
error: almost complete ascii letter range
|
||||
--> $DIR/almost_complete_letter_range.rs:36:9
|
||||
--> $DIR/almost_complete_letter_range.rs:43:9
|
||||
|
|
||||
LL | b'a'..b'z' if true => 1,
|
||||
| ^^^^--^^^^
|
||||
|
@ -49,7 +49,7 @@ LL | b'a'..b'z' if true => 1,
|
|||
| help: use an inclusive range: `..=`
|
||||
|
||||
error: almost complete ascii letter range
|
||||
--> $DIR/almost_complete_letter_range.rs:37:9
|
||||
--> $DIR/almost_complete_letter_range.rs:44:9
|
||||
|
|
||||
LL | b'A'..b'Z' if true => 2,
|
||||
| ^^^^--^^^^
|
||||
|
@ -57,7 +57,7 @@ LL | b'A'..b'Z' if true => 2,
|
|||
| help: use an inclusive range: `..=`
|
||||
|
||||
error: almost complete ascii letter range
|
||||
--> $DIR/almost_complete_letter_range.rs:44:9
|
||||
--> $DIR/almost_complete_letter_range.rs:51:9
|
||||
|
|
||||
LL | 'a'..'z' if true => 1,
|
||||
| ^^^--^^^
|
||||
|
@ -65,7 +65,7 @@ LL | 'a'..'z' if true => 1,
|
|||
| help: use an inclusive range: `..=`
|
||||
|
||||
error: almost complete ascii letter range
|
||||
--> $DIR/almost_complete_letter_range.rs:45:9
|
||||
--> $DIR/almost_complete_letter_range.rs:52:9
|
||||
|
|
||||
LL | 'A'..'Z' if true => 2,
|
||||
| ^^^--^^^
|
||||
|
@ -73,7 +73,7 @@ LL | 'A'..'Z' if true => 2,
|
|||
| help: use an inclusive range: `..=`
|
||||
|
||||
error: almost complete ascii letter range
|
||||
--> $DIR/almost_complete_letter_range.rs:55:9
|
||||
--> $DIR/almost_complete_letter_range.rs:62:9
|
||||
|
|
||||
LL | 'a'..'z' => 1,
|
||||
| ^^^--^^^
|
||||
|
@ -81,7 +81,7 @@ LL | 'a'..'z' => 1,
|
|||
| help: use an inclusive range: `...`
|
||||
|
||||
error: almost complete ascii letter range
|
||||
--> $DIR/almost_complete_letter_range.rs:62:13
|
||||
--> $DIR/almost_complete_letter_range.rs:69:13
|
||||
|
|
||||
LL | let _ = 'a'..'z';
|
||||
| ^^^--^^^
|
||||
|
@ -89,7 +89,7 @@ LL | let _ = 'a'..'z';
|
|||
| help: use an inclusive range: `..=`
|
||||
|
||||
error: almost complete ascii letter range
|
||||
--> $DIR/almost_complete_letter_range.rs:64:9
|
||||
--> $DIR/almost_complete_letter_range.rs:71:9
|
||||
|
|
||||
LL | 'a'..'z' => 1,
|
||||
| ^^^--^^^
|
||||
|
|
Loading…
Reference in a new issue