Auto merge of #131145 - ismailarilik:handle_potential_query_instability_lint_for_rustc_metadata, r=compiler-errors
Handle `rustc_metadata` cases of `rustc::potential_query_instability` lint This PR removes `#![allow(rustc::potential_query_instability)]` line from [`compiler/rustc_metadata/src/lib.rs`](https://github.com/rust-lang/rust/blob/master/compiler/rustc_metadata/src/lib.rs#L3) and converts `FxHash{Map,Set}` types into `FxIndex{Map,Set}` to suppress lint errors. A somewhat tracking issue: https://github.com/rust-lang/rust/issues/84447
This commit is contained in:
commit
9ff5fc4ffb
@ -1,6 +1,5 @@
|
|||||||
// tidy-alphabetical-start
|
// tidy-alphabetical-start
|
||||||
#![allow(internal_features)]
|
#![allow(internal_features)]
|
||||||
#![allow(rustc::potential_query_instability)]
|
|
||||||
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
|
#![doc(html_root_url = "https://doc.rust-lang.org/nightly/nightly-rustc/")]
|
||||||
#![doc(rust_logo)]
|
#![doc(rust_logo)]
|
||||||
#![feature(control_flow_enum)]
|
#![feature(control_flow_enum)]
|
||||||
|
@ -218,7 +218,7 @@
|
|||||||
use std::path::{Path, PathBuf};
|
use std::path::{Path, PathBuf};
|
||||||
use std::{cmp, fmt};
|
use std::{cmp, fmt};
|
||||||
|
|
||||||
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
|
use rustc_data_structures::fx::{FxHashSet, FxIndexMap};
|
||||||
use rustc_data_structures::memmap::Mmap;
|
use rustc_data_structures::memmap::Mmap;
|
||||||
use rustc_data_structures::owned_slice::slice_owned;
|
use rustc_data_structures::owned_slice::slice_owned;
|
||||||
use rustc_data_structures::svh::Svh;
|
use rustc_data_structures::svh::Svh;
|
||||||
@ -385,7 +385,7 @@ fn find_library_crate(
|
|||||||
let dylib_suffix = &self.target.dll_suffix;
|
let dylib_suffix = &self.target.dll_suffix;
|
||||||
let staticlib_suffix = &self.target.staticlib_suffix;
|
let staticlib_suffix = &self.target.staticlib_suffix;
|
||||||
|
|
||||||
let mut candidates: FxHashMap<_, (FxHashMap<_, _>, FxHashMap<_, _>, FxHashMap<_, _>)> =
|
let mut candidates: FxIndexMap<_, (FxIndexMap<_, _>, FxIndexMap<_, _>, FxIndexMap<_, _>)> =
|
||||||
Default::default();
|
Default::default();
|
||||||
|
|
||||||
// First, find all possible candidate rlibs and dylibs purely based on
|
// First, find all possible candidate rlibs and dylibs purely based on
|
||||||
@ -460,7 +460,7 @@ fn find_library_crate(
|
|||||||
// A Library candidate is created if the metadata for the set of
|
// A Library candidate is created if the metadata for the set of
|
||||||
// libraries corresponds to the crate id and hash criteria that this
|
// libraries corresponds to the crate id and hash criteria that this
|
||||||
// search is being performed for.
|
// search is being performed for.
|
||||||
let mut libraries = FxHashMap::default();
|
let mut libraries = FxIndexMap::default();
|
||||||
for (_hash, (rlibs, rmetas, dylibs)) in candidates {
|
for (_hash, (rlibs, rmetas, dylibs)) in candidates {
|
||||||
if let Some((svh, lib)) = self.extract_lib(rlibs, rmetas, dylibs)? {
|
if let Some((svh, lib)) = self.extract_lib(rlibs, rmetas, dylibs)? {
|
||||||
libraries.insert(svh, lib);
|
libraries.insert(svh, lib);
|
||||||
@ -494,9 +494,9 @@ fn find_library_crate(
|
|||||||
|
|
||||||
fn extract_lib(
|
fn extract_lib(
|
||||||
&mut self,
|
&mut self,
|
||||||
rlibs: FxHashMap<PathBuf, PathKind>,
|
rlibs: FxIndexMap<PathBuf, PathKind>,
|
||||||
rmetas: FxHashMap<PathBuf, PathKind>,
|
rmetas: FxIndexMap<PathBuf, PathKind>,
|
||||||
dylibs: FxHashMap<PathBuf, PathKind>,
|
dylibs: FxIndexMap<PathBuf, PathKind>,
|
||||||
) -> Result<Option<(Svh, Library)>, CrateError> {
|
) -> Result<Option<(Svh, Library)>, CrateError> {
|
||||||
let mut slot = None;
|
let mut slot = None;
|
||||||
// Order here matters, rmeta should come first. See comment in
|
// Order here matters, rmeta should come first. See comment in
|
||||||
@ -534,7 +534,7 @@ fn needs_crate_flavor(&self, flavor: CrateFlavor) -> bool {
|
|||||||
// The `PathBuf` in `slot` will only be used for diagnostic purposes.
|
// The `PathBuf` in `slot` will only be used for diagnostic purposes.
|
||||||
fn extract_one(
|
fn extract_one(
|
||||||
&mut self,
|
&mut self,
|
||||||
m: FxHashMap<PathBuf, PathKind>,
|
m: FxIndexMap<PathBuf, PathKind>,
|
||||||
flavor: CrateFlavor,
|
flavor: CrateFlavor,
|
||||||
slot: &mut Option<(Svh, MetadataBlob, PathBuf)>,
|
slot: &mut Option<(Svh, MetadataBlob, PathBuf)>,
|
||||||
) -> Result<Option<(PathBuf, PathKind)>, CrateError> {
|
) -> Result<Option<(PathBuf, PathKind)>, CrateError> {
|
||||||
@ -702,9 +702,9 @@ fn find_commandline_library(&mut self) -> Result<Option<Library>, CrateError> {
|
|||||||
// First, filter out all libraries that look suspicious. We only accept
|
// First, filter out all libraries that look suspicious. We only accept
|
||||||
// files which actually exist that have the correct naming scheme for
|
// files which actually exist that have the correct naming scheme for
|
||||||
// rlibs/dylibs.
|
// rlibs/dylibs.
|
||||||
let mut rlibs = FxHashMap::default();
|
let mut rlibs = FxIndexMap::default();
|
||||||
let mut rmetas = FxHashMap::default();
|
let mut rmetas = FxIndexMap::default();
|
||||||
let mut dylibs = FxHashMap::default();
|
let mut dylibs = FxIndexMap::default();
|
||||||
for loc in &self.exact_paths {
|
for loc in &self.exact_paths {
|
||||||
if !loc.canonicalized().exists() {
|
if !loc.canonicalized().exists() {
|
||||||
return Err(CrateError::ExternLocationNotExist(
|
return Err(CrateError::ExternLocationNotExist(
|
||||||
|
@ -187,8 +187,8 @@ pub struct ResolverGlobalCtxt {
|
|||||||
/// Mapping from ident span to path span for paths that don't exist as written, but that
|
/// Mapping from ident span to path span for paths that don't exist as written, but that
|
||||||
/// exist under `std`. For example, wrote `str::from_utf8` instead of `std::str::from_utf8`.
|
/// exist under `std`. For example, wrote `str::from_utf8` instead of `std::str::from_utf8`.
|
||||||
pub confused_type_with_std_module: FxIndexMap<Span, Span>,
|
pub confused_type_with_std_module: FxIndexMap<Span, Span>,
|
||||||
pub doc_link_resolutions: FxHashMap<LocalDefId, DocLinkResMap>,
|
pub doc_link_resolutions: FxIndexMap<LocalDefId, DocLinkResMap>,
|
||||||
pub doc_link_traits_in_scope: FxHashMap<LocalDefId, Vec<DefId>>,
|
pub doc_link_traits_in_scope: FxIndexMap<LocalDefId, Vec<DefId>>,
|
||||||
pub all_macro_rules: FxHashMap<Symbol, Res<ast::NodeId>>,
|
pub all_macro_rules: FxHashMap<Symbol, Res<ast::NodeId>>,
|
||||||
pub stripped_cfg_items: Steal<Vec<StrippedCfgItem>>,
|
pub stripped_cfg_items: Steal<Vec<StrippedCfgItem>>,
|
||||||
}
|
}
|
||||||
|
@ -1196,8 +1196,8 @@ pub struct Resolver<'ra, 'tcx> {
|
|||||||
stripped_cfg_items: Vec<StrippedCfgItem<NodeId>>,
|
stripped_cfg_items: Vec<StrippedCfgItem<NodeId>>,
|
||||||
|
|
||||||
effective_visibilities: EffectiveVisibilities,
|
effective_visibilities: EffectiveVisibilities,
|
||||||
doc_link_resolutions: FxHashMap<LocalDefId, DocLinkResMap>,
|
doc_link_resolutions: FxIndexMap<LocalDefId, DocLinkResMap>,
|
||||||
doc_link_traits_in_scope: FxHashMap<LocalDefId, Vec<DefId>>,
|
doc_link_traits_in_scope: FxIndexMap<LocalDefId, Vec<DefId>>,
|
||||||
all_macro_rules: FxHashMap<Symbol, Res>,
|
all_macro_rules: FxHashMap<Symbol, Res>,
|
||||||
|
|
||||||
/// Invocation ids of all glob delegations.
|
/// Invocation ids of all glob delegations.
|
||||||
|
Loading…
Reference in New Issue
Block a user