mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-25 15:04:33 +00:00
23 lines
496 B
Rust
23 lines
496 B
Rust
#![feature(plugin)]
|
|
#![plugin(clippy)]
|
|
|
|
#[macro_use]
|
|
extern crate lazy_static;
|
|
|
|
use std::collections::HashMap;
|
|
|
|
#[deny(mut_mut)]
|
|
#[allow(unused_variables, unused_mut)]
|
|
fn main() {
|
|
lazy_static! {
|
|
static ref MUT_MAP : HashMap<usize, &'static str> = {
|
|
let mut m = HashMap::new();
|
|
let mut zero = &mut &mut "zero";
|
|
m.insert(0, "zero");
|
|
m
|
|
};
|
|
static ref MUT_COUNT : usize = MUT_MAP.len();
|
|
}
|
|
assert!(*MUT_COUNT == 1);
|
|
}
|