2018-10-06 18:18:06 +02:00
|
|
|
// Copyright 2014-2018 The Rust Project Developers. See the COPYRIGHT
|
|
|
|
// file at the top-level directory of this distribution.
|
|
|
|
//
|
|
|
|
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
|
|
|
|
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
|
|
|
|
// option. This file may not be copied, modified, or distributed
|
|
|
|
// except according to those terms.
|
|
|
|
|
|
|
|
|
2018-07-30 11:33:44 +02:00
|
|
|
#![feature(tool_lints)]
|
|
|
|
|
|
|
|
#![deny(clippy::mut_mut, clippy::zero_ptr, clippy::cmp_nan)]
|
2017-03-07 12:58:07 +01:00
|
|
|
#![allow(dead_code)]
|
2015-05-26 01:45:15 +02:00
|
|
|
|
2018-05-11 13:20:39 +02:00
|
|
|
// compiletest + extern crates doesn't work together
|
|
|
|
//#[macro_use]
|
|
|
|
//extern crate lazy_static;
|
2015-05-26 01:45:15 +02:00
|
|
|
|
2018-05-11 13:20:39 +02:00
|
|
|
//use std::collections::HashMap;
|
2015-05-26 13:52:40 +02:00
|
|
|
|
2017-03-07 12:58:07 +01: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
|
|
|
|
const BAA: *const i32 = 0 as *const i32;
|
|
|
|
static mut BAR: *const i32 = BAA;
|
|
|
|
static mut FOO: *const i32 = 0 as *const i32;
|
|
|
|
static mut BUH: bool = 42.0 < std::f32::NAN;
|
|
|
|
|
2015-05-26 13:52:40 +02:00
|
|
|
#[allow(unused_variables, unused_mut)]
|
2016-03-07 19:08:46 +01:00
|
|
|
fn main() {
|
2018-05-11 13:20:39 +02:00
|
|
|
/*
|
2015-08-11 20:22:20 +02: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 16:48:48 +02:00
|
|
|
assert_eq!(*MUT_COUNT, 1);
|
2018-05-11 13:20:39 +02:00
|
|
|
*/
|
2017-03-07 12:58:07 +01:00
|
|
|
// FIXME: don't lint in array length, requires `check_body`
|
|
|
|
//let _ = [""; (42.0 < std::f32::NAN) as usize];
|
2015-05-26 13:52:40 +02:00
|
|
|
}
|