2019-04-05 05:22:36 +00:00
|
|
|
// run-pass
|
|
|
|
|
2018-07-30 09:33:44 +00:00
|
|
|
#![deny(clippy::mut_mut, clippy::zero_ptr, clippy::cmp_nan)]
|
2017-03-07 11:58:07 +00:00
|
|
|
#![allow(dead_code)]
|
2015-05-25 23:45:15 +00:00
|
|
|
|
2019-02-06 06:45:57 +00:00
|
|
|
// FIXME: compiletest + extern crates doesn't work together. To make this test work, it would need
|
|
|
|
// the following three lines and the lazy_static crate.
|
|
|
|
//
|
|
|
|
// #[macro_use]
|
|
|
|
// extern crate lazy_static;
|
|
|
|
// use std::collections::HashMap;
|
2015-05-25 23:45:15 +00:00
|
|
|
|
2019-02-06 06:45:57 +00:00
|
|
|
/// ensure that we don't suggest `is_nan` and `is_null` inside constants
|
|
|
|
/// FIXME: once const fn is stable, suggest these functions again in constants
|
2015-05-26 11:52:40 +00:00
|
|
|
|
2017-03-07 11:58:07 +00:00
|
|
|
const BAA: *const i32 = 0 as *const i32;
|
|
|
|
static mut BAR: *const i32 = BAA;
|
|
|
|
static mut FOO: *const i32 = 0 as *const i32;
|
2020-04-07 22:04:33 +00:00
|
|
|
static mut BUH: bool = 42.0 < f32::NAN;
|
2017-03-07 11:58:07 +00:00
|
|
|
|
2015-05-26 11:52:40 +00:00
|
|
|
#[allow(unused_variables, unused_mut)]
|
2016-03-07 18:08:46 +00:00
|
|
|
fn main() {
|
2018-05-11 11:20:39 +00:00
|
|
|
/*
|
2015-08-11 18:22:20 +00:00
|
|
|
lazy_static! {
|
|
|
|
static ref MUT_MAP : HashMap<usize, &'static str> = {
|
|
|
|
let mut m = HashMap::new();
|
|
|
|
m.insert(0, "zero");
|
|
|
|
m
|
|
|
|
};
|
|
|
|
static ref MUT_COUNT : usize = MUT_MAP.len();
|
|
|
|
}
|
2017-04-06 14:48:48 +00:00
|
|
|
assert_eq!(*MUT_COUNT, 1);
|
2018-05-11 11:20:39 +00:00
|
|
|
*/
|
2017-03-07 11:58:07 +00:00
|
|
|
// FIXME: don't lint in array length, requires `check_body`
|
2020-04-07 22:04:33 +00:00
|
|
|
//let _ = [""; (42.0 < f32::NAN) as usize];
|
2015-05-26 11:52:40 +00:00
|
|
|
}
|