2022-06-04 11:34:07 +00:00
|
|
|
// run-rustfix
|
|
|
|
// edition:2018
|
2023-03-24 13:04:35 +00:00
|
|
|
// aux-build:proc_macros.rs
|
2022-06-04 11:34:07 +00:00
|
|
|
|
|
|
|
#![feature(exclusive_range_pattern)]
|
|
|
|
#![feature(stmt_expr_attributes)]
|
2022-12-17 13:12:54 +00:00
|
|
|
#![warn(clippy::almost_complete_range)]
|
2022-06-04 11:34:07 +00:00
|
|
|
#![allow(ellipsis_inclusive_range_patterns)]
|
2022-06-16 15:39:06 +00:00
|
|
|
#![allow(clippy::needless_parens_on_range_literals)]
|
2022-12-17 13:12:54 +00:00
|
|
|
#![allow(clippy::double_parens)]
|
2022-06-04 11:34:07 +00:00
|
|
|
|
2023-03-24 13:04:35 +00:00
|
|
|
extern crate proc_macros;
|
|
|
|
use proc_macros::{external, inline_macros};
|
2022-09-21 17:02:37 +00:00
|
|
|
|
2023-03-24 13:04:35 +00:00
|
|
|
#[inline_macros]
|
2022-06-04 11:34:07 +00:00
|
|
|
fn main() {
|
|
|
|
#[rustfmt::skip]
|
|
|
|
{
|
|
|
|
let _ = ('a') ..'z';
|
|
|
|
let _ = 'A' .. ('Z');
|
2022-12-17 13:12:54 +00:00
|
|
|
let _ = ((('0'))) .. ('9');
|
2022-06-04 11:34:07 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
let _ = 'b'..'z';
|
|
|
|
let _ = 'B'..'Z';
|
2022-12-17 13:12:54 +00:00
|
|
|
let _ = '1'..'9';
|
2022-06-04 11:34:07 +00:00
|
|
|
|
|
|
|
let _ = (b'a')..(b'z');
|
|
|
|
let _ = b'A'..b'Z';
|
2022-12-17 13:12:54 +00:00
|
|
|
let _ = b'0'..b'9';
|
2022-06-04 11:34:07 +00:00
|
|
|
|
|
|
|
let _ = b'b'..b'z';
|
|
|
|
let _ = b'B'..b'Z';
|
2022-12-17 13:12:54 +00:00
|
|
|
let _ = b'1'..b'9';
|
2022-06-04 11:34:07 +00:00
|
|
|
|
2023-03-24 13:04:35 +00:00
|
|
|
let _ = inline!('a')..'z';
|
|
|
|
let _ = inline!('A')..'Z';
|
|
|
|
let _ = inline!('0')..'9';
|
2022-06-04 11:34:07 +00:00
|
|
|
|
|
|
|
let _ = match 0u8 {
|
|
|
|
b'a'..b'z' if true => 1,
|
|
|
|
b'A'..b'Z' if true => 2,
|
2022-12-17 13:12:54 +00:00
|
|
|
b'0'..b'9' if true => 3,
|
|
|
|
b'b'..b'z' => 4,
|
|
|
|
b'B'..b'Z' => 5,
|
|
|
|
b'1'..b'9' => 6,
|
|
|
|
_ => 7,
|
2022-06-04 11:34:07 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
let _ = match 'x' {
|
|
|
|
'a'..'z' if true => 1,
|
|
|
|
'A'..'Z' if true => 2,
|
2022-12-17 13:12:54 +00:00
|
|
|
'0'..'9' if true => 3,
|
|
|
|
'b'..'z' => 4,
|
|
|
|
'B'..'Z' => 5,
|
|
|
|
'1'..'9' => 6,
|
|
|
|
_ => 7,
|
2022-06-04 11:34:07 +00:00
|
|
|
};
|
2022-09-21 17:02:37 +00:00
|
|
|
|
2023-03-24 13:04:35 +00:00
|
|
|
external!(
|
|
|
|
let _ = 'a'..'z';
|
|
|
|
let _ = 'A'..'Z';
|
|
|
|
let _ = '0'..'9';
|
|
|
|
);
|
|
|
|
inline!(
|
|
|
|
let _ = 'a'..'z';
|
|
|
|
let _ = 'A'..'Z';
|
|
|
|
let _ = '0'..'9';
|
|
|
|
);
|
2022-06-04 11:34:07 +00:00
|
|
|
}
|
|
|
|
|
2022-12-01 17:29:38 +00:00
|
|
|
#[clippy::msrv = "1.25"]
|
2022-06-04 11:34:07 +00:00
|
|
|
fn _under_msrv() {
|
|
|
|
let _ = match 'a' {
|
|
|
|
'a'..'z' => 1,
|
2022-12-17 13:12:54 +00:00
|
|
|
'A'..'Z' => 2,
|
|
|
|
'0'..'9' => 3,
|
|
|
|
_ => 4,
|
2022-06-04 11:34:07 +00:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2022-12-01 17:29:38 +00:00
|
|
|
#[clippy::msrv = "1.26"]
|
2022-06-04 11:34:07 +00:00
|
|
|
fn _meets_msrv() {
|
|
|
|
let _ = 'a'..'z';
|
2022-12-17 13:12:54 +00:00
|
|
|
let _ = 'A'..'Z';
|
|
|
|
let _ = '0'..'9';
|
2022-06-04 11:34:07 +00:00
|
|
|
let _ = match 'a' {
|
|
|
|
'a'..'z' => 1,
|
2022-12-17 13:12:54 +00:00
|
|
|
'A'..'Z' => 1,
|
|
|
|
'0'..'9' => 3,
|
|
|
|
_ => 4,
|
2022-06-04 11:34:07 +00:00
|
|
|
};
|
|
|
|
}
|