2023-04-20 09:37:15 -05:00
|
|
|
//@edition:2018
|
2023-04-20 10:19:36 -05:00
|
|
|
//@aux-build:proc_macros.rs:proc-macro
|
2022-05-30 21:07:49 -05:00
|
|
|
|
|
|
|
#![feature(exclusive_range_pattern)]
|
|
|
|
#![feature(stmt_expr_attributes)]
|
2022-12-09 12:29:50 -06:00
|
|
|
#![warn(clippy::almost_complete_range)]
|
2022-05-30 21:07:49 -05:00
|
|
|
#![allow(ellipsis_inclusive_range_patterns)]
|
2022-06-05 15:12:30 -05:00
|
|
|
#![allow(clippy::needless_parens_on_range_literals)]
|
2022-12-09 12:29:50 -06:00
|
|
|
#![allow(clippy::double_parens)]
|
2022-05-30 21:07:49 -05:00
|
|
|
|
2023-03-07 08:40:55 -06:00
|
|
|
extern crate proc_macros;
|
|
|
|
use proc_macros::{external, inline_macros};
|
2022-09-12 03:44:44 -05:00
|
|
|
|
2023-03-07 08:40:55 -06:00
|
|
|
#[inline_macros]
|
2022-05-30 21:07:49 -05:00
|
|
|
fn main() {
|
|
|
|
#[rustfmt::skip]
|
|
|
|
{
|
|
|
|
let _ = ('a') ..'z';
|
|
|
|
let _ = 'A' .. ('Z');
|
2022-12-09 12:29:50 -06:00
|
|
|
let _ = ((('0'))) .. ('9');
|
2022-05-30 21:07:49 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
let _ = 'b'..'z';
|
|
|
|
let _ = 'B'..'Z';
|
2022-12-09 12:29:50 -06:00
|
|
|
let _ = '1'..'9';
|
2022-05-30 21:07:49 -05:00
|
|
|
|
|
|
|
let _ = (b'a')..(b'z');
|
|
|
|
let _ = b'A'..b'Z';
|
2022-12-09 12:29:50 -06:00
|
|
|
let _ = b'0'..b'9';
|
2022-05-30 21:07:49 -05:00
|
|
|
|
|
|
|
let _ = b'b'..b'z';
|
|
|
|
let _ = b'B'..b'Z';
|
2022-12-09 12:29:50 -06:00
|
|
|
let _ = b'1'..b'9';
|
2022-05-30 21:07:49 -05:00
|
|
|
|
2023-03-07 08:40:55 -06:00
|
|
|
let _ = inline!('a')..'z';
|
|
|
|
let _ = inline!('A')..'Z';
|
|
|
|
let _ = inline!('0')..'9';
|
2022-05-30 21:07:49 -05:00
|
|
|
|
|
|
|
let _ = match 0u8 {
|
|
|
|
b'a'..b'z' if true => 1,
|
|
|
|
b'A'..b'Z' if true => 2,
|
2022-12-09 12:29:50 -06: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-05-30 21:07:49 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
let _ = match 'x' {
|
|
|
|
'a'..'z' if true => 1,
|
|
|
|
'A'..'Z' if true => 2,
|
2022-12-09 12:29:50 -06:00
|
|
|
'0'..'9' if true => 3,
|
|
|
|
'b'..'z' => 4,
|
|
|
|
'B'..'Z' => 5,
|
|
|
|
'1'..'9' => 6,
|
|
|
|
_ => 7,
|
2022-05-30 21:07:49 -05:00
|
|
|
};
|
2022-09-13 02:51:32 -05:00
|
|
|
|
2023-03-07 08:40:55 -06:00
|
|
|
external!(
|
|
|
|
let _ = 'a'..'z';
|
|
|
|
let _ = 'A'..'Z';
|
|
|
|
let _ = '0'..'9';
|
|
|
|
);
|
|
|
|
inline!(
|
|
|
|
let _ = 'a'..'z';
|
|
|
|
let _ = 'A'..'Z';
|
|
|
|
let _ = '0'..'9';
|
|
|
|
);
|
2022-05-30 21:07:49 -05:00
|
|
|
}
|
|
|
|
|
2022-11-19 06:50:02 -06:00
|
|
|
#[clippy::msrv = "1.25"]
|
2022-05-30 21:07:49 -05:00
|
|
|
fn _under_msrv() {
|
|
|
|
let _ = match 'a' {
|
|
|
|
'a'..'z' => 1,
|
2022-12-09 12:29:50 -06:00
|
|
|
'A'..'Z' => 2,
|
|
|
|
'0'..'9' => 3,
|
|
|
|
_ => 4,
|
2022-05-30 21:07:49 -05:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2022-11-19 06:50:02 -06:00
|
|
|
#[clippy::msrv = "1.26"]
|
2022-05-30 21:07:49 -05:00
|
|
|
fn _meets_msrv() {
|
|
|
|
let _ = 'a'..'z';
|
2022-12-09 12:29:50 -06:00
|
|
|
let _ = 'A'..'Z';
|
|
|
|
let _ = '0'..'9';
|
2022-05-30 21:07:49 -05:00
|
|
|
let _ = match 'a' {
|
|
|
|
'a'..'z' => 1,
|
2022-12-09 12:29:50 -06:00
|
|
|
'A'..'Z' => 1,
|
|
|
|
'0'..'9' => 3,
|
|
|
|
_ => 4,
|
2022-05-30 21:07:49 -05:00
|
|
|
};
|
|
|
|
}
|