Auto merge of #81393 - pnkfelix:issue-81296-make-weak-item-traversal-deterministic, r=estebank

Make weak item traversal deterministic

Fix #81296.

(No test added. The relevant test *is* ui/panic-handler/weak-lang-item.rs, and this change should make it less flaky.)
This commit is contained in:
bors 2021-01-27 00:19:45 +00:00
commit 78e22069d0
2 changed files with 4 additions and 4 deletions

View file

@ -4,7 +4,7 @@ use crate::def_id::DefId;
use crate::{lang_items, LangItem, LanguageItems};
use rustc_ast as ast;
use rustc_data_structures::fx::FxHashMap;
use rustc_data_structures::stable_map::StableMap;
use rustc_span::symbol::{sym, Symbol};
use std::lazy::SyncLazy;
@ -12,8 +12,8 @@ use std::lazy::SyncLazy;
macro_rules! weak_lang_items {
($($name:ident, $item:ident, $sym:ident;)*) => (
pub static WEAK_ITEMS_REFS: SyncLazy<FxHashMap<Symbol, LangItem>> = SyncLazy::new(|| {
let mut map = FxHashMap::default();
pub static WEAK_ITEMS_REFS: SyncLazy<StableMap<Symbol, LangItem>> = SyncLazy::new(|| {
let mut map = StableMap::default();
$(map.insert(sym::$name, LangItem::$item);)*
map
});