• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 #![allow(unknown_lints)]
2 #![deny(unexpected_cfgs)]
3 
4 macro_rules! test_cfgs {
5     ($($cfg:ident,)*) => {$({
6         let cfg_desc = format!("cfg!({})", stringify!($cfg));
7         if cfg!($cfg) {
8             println!("Enabled:    {}", cfg_desc);
9         } else {
10             println!("Disabled:   {}", cfg_desc);
11         }
12     })*};
13 
14 }
15 
main()16 pub fn main() {
17     test_cfgs!(
18         // emit_rustc_version
19         rustc_1_0,
20         rustc_7_4294967295,
21         // emit_has_path, emit_path_cfg
22         has_std__vec__Vec,
23         has_path_std_vec,
24         has_dummy__DummyPath,
25         has_path_dummy,
26         // emit_has_trait, emit_trait_cfg
27         has_std__ops__Add,
28         has_trait_add,
29         has_dummy__DummyTrait,
30         has_trait_dummy,
31         // emit_has_type, has_type_i32
32         has_i32,
33         has_type_i32,
34         has_i7billion,
35         has_type_i7billion,
36         // emit_expression_cfg
37         has_working_addition,
38         has_working_5xor,
39         // emit_constant_cfg
40         has_const_7,
41         has_const_file_open,
42     );
43 }
44