1 // compile-flags: -Z unstable-options
3 #![feature(rustc_private)]
4 #![deny(rustc::default_hash_types)]
6 extern crate rustc_data_structures;
8 use rustc_data_structures::fx::{FxHashMap, FxHashSet};
9 use std::collections::{HashMap, HashSet};
16 let _map: HashMap<String, String> = HashMap::default();
17 //~^ ERROR prefer `FxHashMap` over `HashMap`, it has better performance
18 //~^^ ERROR prefer `FxHashMap` over `HashMap`, it has better performance
19 let _set: HashSet<String> = HashSet::default();
20 //~^ ERROR prefer `FxHashSet` over `HashSet`, it has better performance
21 //~^^ ERROR prefer `FxHashSet` over `HashSet`, it has better performance
23 // test that the lint doesn't also match the Fx variants themselves
24 let _fx_map: FxHashMap<String, String> = FxHashMap::default();
25 let _fx_set: FxHashSet<String> = FxHashSet::default();
27 // test another struct of the same name