]> git.lizzy.rs Git - rust.git/blob - tests/ui/decimal_literal_representation.rs
Auto merge of #3635 - matthiaskrgr:revert_random_state_3603, r=xfix
[rust.git] / tests / ui / decimal_literal_representation.rs
1 // Copyright 2014-2018 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution.
3 //
4 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
5 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
6 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
7 // option. This file may not be copied, modified, or distributed
8 // except according to those terms.
9
10 #[warn(clippy::decimal_literal_representation)]
11 #[allow(unused_variables)]
12 #[rustfmt::skip]
13 fn main() {
14     let good = (       // Hex:
15         127,           // 0x7F
16         256,           // 0x100
17         511,           // 0x1FF
18         2048,          // 0x800
19         4090,          // 0xFFA
20         16_371,        // 0x3FF3
21         61_683,        // 0xF0F3
22         2_131_750_925, // 0x7F0F_F00D
23     );
24     let bad = (        // Hex:
25         32_773,        // 0x8005
26         65_280,        // 0xFF00
27         2_131_750_927, // 0x7F0F_F00F
28         2_147_483_647, // 0x7FFF_FFFF
29         4_042_322_160, // 0xF0F0_F0F0
30     );
31 }