]> git.lizzy.rs Git - rust.git/blob - tests/run-pass/mut_mut_macro.rs
Remove all mention and testing of #[plugin(clippy)] and warn if used
[rust.git] / tests / run-pass / mut_mut_macro.rs
1 #![deny(mut_mut, zero_ptr, cmp_nan)]
2 #![allow(dead_code)]
3
4 // compiletest + extern crates doesn't work together
5 //#[macro_use]
6 //extern crate lazy_static;
7
8 //use std::collections::HashMap;
9
10 // ensure that we don't suggest `is_nan` and `is_null` inside constants
11 // FIXME: once const fn is stable, suggest these functions again in constants
12 const BAA: *const i32 = 0 as *const i32;
13 static mut BAR: *const i32 = BAA;
14 static mut FOO: *const i32 = 0 as *const i32;
15 static mut BUH: bool = 42.0 < std::f32::NAN;
16
17 #[allow(unused_variables, unused_mut)]
18 fn main() {
19     /*
20     lazy_static! {
21         static ref MUT_MAP : HashMap<usize, &'static str> = {
22             let mut m = HashMap::new();
23             m.insert(0, "zero");
24             m
25         };
26         static ref MUT_COUNT : usize = MUT_MAP.len();
27     }
28     assert_eq!(*MUT_COUNT, 1);
29     */
30     // FIXME: don't lint in array length, requires `check_body`
31     //let _ = [""; (42.0 < std::f32::NAN) as usize];
32 }