Add test.

This commit is contained in:
S. van Dijk 2022-09-12 10:44:44 +02:00
parent 178f502970
commit 4a6f7abeeb
No known key found for this signature in database
GPG key ID: 15A87C95891B3301
3 changed files with 26 additions and 12 deletions

View file

@ -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,

View file

@ -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,

View file

@ -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,
| ^^^--^^^