]> git.lizzy.rs Git - rust.git/blob - tests/ui/decimal_literal_representation.rs
Merge pull request #3265 from mikerite/fix-export
[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
11 #![feature(tool_lints)]
12
13
14 #[warn(clippy::decimal_literal_representation)]
15 #[allow(unused_variables)]
16 fn main() {
17     let good = (        // Hex:
18         127,            // 0x7F
19         256,            // 0x100
20         511,            // 0x1FF
21         2048,           // 0x800
22         4090,           // 0xFFA
23         16_371,         // 0x3FF3
24         61_683,         // 0xF0F3
25         2_131_750_925,  // 0x7F0F_F00D
26     );
27     let bad = (        // Hex:
28         32_773,        // 0x8005
29         65_280,        // 0xFF00
30         2_131_750_927, // 0x7F0F_F00F
31         2_147_483_647, // 0x7FFF_FFFF
32         4_042_322_160, // 0xF0F0_F0F0
33     );
34 }