2019-09-25 06:49:38 -05:00
|
|
|
// does not test any rustfixable lints
|
2019-09-25 06:46:43 -05:00
|
|
|
|
2018-07-28 10:34:52 -05:00
|
|
|
#![warn(clippy::mixed_case_hex_literals)]
|
|
|
|
#![warn(clippy::zero_prefixed_literal)]
|
2021-11-04 07:52:36 -05:00
|
|
|
#![warn(clippy::unseparated_literal_suffix)]
|
|
|
|
#![warn(clippy::separated_literal_suffix)]
|
2021-07-20 22:23:22 -05:00
|
|
|
#![allow(dead_code, overflowing_literals)]
|
2016-08-05 11:30:07 -05:00
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let ok1 = 0xABCD;
|
|
|
|
let ok3 = 0xab_cd;
|
|
|
|
let ok4 = 0xab_cd_i32;
|
|
|
|
let ok5 = 0xAB_CD_u32;
|
|
|
|
let ok5 = 0xAB_CD_isize;
|
2017-02-08 07:58:07 -06:00
|
|
|
let fail1 = 0xabCD;
|
|
|
|
let fail2 = 0xabCD_u32;
|
|
|
|
let fail2 = 0xabCD_isize;
|
2017-07-19 18:56:32 -05:00
|
|
|
let fail_multi_zero = 000_123usize;
|
2016-08-05 11:50:02 -05:00
|
|
|
|
2016-08-20 11:11:15 -05:00
|
|
|
let ok9 = 0;
|
|
|
|
let ok10 = 0_i64;
|
|
|
|
let fail8 = 0123;
|
2017-02-08 07:58:07 -06:00
|
|
|
|
2016-08-28 10:59:01 -05:00
|
|
|
let ok11 = 0o123;
|
2017-07-19 18:56:32 -05:00
|
|
|
let ok12 = 0b10_1010;
|
2018-05-28 06:55:27 -05:00
|
|
|
|
2018-05-28 07:12:20 -05:00
|
|
|
let ok13 = 0xab_abcd;
|
|
|
|
let ok14 = 0xBAFE_BAFE;
|
|
|
|
let ok15 = 0xab_cabc_abca_bcab_cabc;
|
|
|
|
let ok16 = 0xFE_BAFE_ABAB_ABCD;
|
|
|
|
let ok17 = 0x123_4567_8901_usize;
|
2020-02-12 23:39:29 -06:00
|
|
|
let ok18 = 0xF;
|
2018-05-28 07:12:20 -05:00
|
|
|
|
2018-09-02 16:07:55 -05:00
|
|
|
let fail19 = 12_3456_21;
|
|
|
|
let fail22 = 3__4___23;
|
|
|
|
let fail23 = 3__16___23;
|
2020-10-28 17:36:07 -05:00
|
|
|
|
|
|
|
let fail24 = 0xAB_ABC_AB;
|
|
|
|
let fail25 = 0b01_100_101;
|
|
|
|
let ok26 = 0x6_A0_BF;
|
|
|
|
let ok27 = 0b1_0010_0101;
|
2016-08-05 11:30:07 -05:00
|
|
|
}
|
2022-10-15 08:10:50 -05:00
|
|
|
|
|
|
|
fn issue9651() {
|
|
|
|
// lint but octal form is not possible here
|
|
|
|
let _ = 08;
|
|
|
|
let _ = 09;
|
|
|
|
let _ = 089;
|
|
|
|
}
|