diff options
| author | Eduard-Mihai Burtescu <edy.burt@gmail.com> | 2018-07-21 22:43:31 +0300 |
|---|---|---|
| committer | Eduard-Mihai Burtescu <edy.burt@gmail.com> | 2018-08-18 20:19:45 +0300 |
| commit | 14aed81d9ac058824af62c37b892b50fdb769912 (patch) | |
| tree | fd88b011d0e0da97da24c184eb3475e7bf265873 /src/librustc_codegen_llvm/back | |
| parent | d5b6b95aef94169b5dbe4dbb1357d4bab1fc9800 (diff) | |
| download | rust-14aed81d9ac058824af62c37b892b50fdb769912.tar.gz rust-14aed81d9ac058824af62c37b892b50fdb769912.zip | |
Use the new Entry::or_default method where possible.
Diffstat (limited to 'src/librustc_codegen_llvm/back')
| -rw-r--r-- | src/librustc_codegen_llvm/back/symbol_export.rs | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/librustc_codegen_llvm/back/symbol_export.rs b/src/librustc_codegen_llvm/back/symbol_export.rs index c78d061a39b..edb1da0b558 100644 --- a/src/librustc_codegen_llvm/back/symbol_export.rs +++ b/src/librustc_codegen_llvm/back/symbol_export.rs @@ -299,7 +299,7 @@ fn upstream_monomorphizations_provider<'a, 'tcx>( let cnums = tcx.all_crate_nums(LOCAL_CRATE); - let mut instances = DefIdMap(); + let mut instances: DefIdMap<FxHashMap<_, _>> = DefIdMap(); let cnum_stable_ids: IndexVec<CrateNum, Fingerprint> = { let mut cnum_stable_ids = IndexVec::from_elem_n(Fingerprint::ZERO, @@ -318,8 +318,7 @@ fn upstream_monomorphizations_provider<'a, 'tcx>( for &cnum in cnums.iter() { for &(ref exported_symbol, _) in tcx.exported_symbols(cnum).iter() { if let &ExportedSymbol::Generic(def_id, substs) = exported_symbol { - let substs_map = instances.entry(def_id) - .or_insert_with(|| FxHashMap()); + let substs_map = instances.entry(def_id).or_default(); match substs_map.entry(substs) { Occupied(mut e) => { |
