Make re-export collection deterministic
Previously, we were using an `FxHashMap` to collect module re-exports. However, re-exports end up getting serialized into crate metadata, which means that metadata generation was non-deterministic. This resulted in spurious error messages changes (e.g. PR #64906) due to pretty-printing implicitly depending on the order of re-exports when computing the proper path to show to the user. See #65042 for a long-term strategy to detect this kind of issue
This commit is contained in:
parent
7870050796
commit
dd403e4ab0
1 changed files with 2 additions and 1 deletions
|
@ -58,6 +58,7 @@ use std::{cmp, fmt, iter, ptr};
|
||||||
use std::collections::BTreeSet;
|
use std::collections::BTreeSet;
|
||||||
use rustc_data_structures::ptr_key::PtrKey;
|
use rustc_data_structures::ptr_key::PtrKey;
|
||||||
use rustc_data_structures::sync::Lrc;
|
use rustc_data_structures::sync::Lrc;
|
||||||
|
use rustc_data_structures::fx::FxIndexMap;
|
||||||
|
|
||||||
use diagnostics::{Suggestion, ImportSuggestion};
|
use diagnostics::{Suggestion, ImportSuggestion};
|
||||||
use diagnostics::{find_span_of_binding_until_next_binding, extend_span_to_previous_binding};
|
use diagnostics::{find_span_of_binding_until_next_binding, extend_span_to_previous_binding};
|
||||||
|
@ -431,7 +432,7 @@ impl ModuleKind {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
type Resolutions<'a> = RefCell<FxHashMap<(Ident, Namespace), &'a RefCell<NameResolution<'a>>>>;
|
type Resolutions<'a> = RefCell<FxIndexMap<(Ident, Namespace), &'a RefCell<NameResolution<'a>>>>;
|
||||||
|
|
||||||
/// One node in the tree of modules.
|
/// One node in the tree of modules.
|
||||||
pub struct ModuleData<'a> {
|
pub struct ModuleData<'a> {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue