Auto merge of #93312 - pierwill:map-all-local-trait-impls, r=cjgillot
Return an indexmap in `all_local_trait_impls` query The data structure previously used here required that `DefId` be `Ord`. As part of #90317, we do not want `DefId` to implement `Ord`.
This commit is contained in:
commit
7cd14d2f56
4 changed files with 5 additions and 7 deletions
|
@ -1100,7 +1100,7 @@ rustc_queries! {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Return all `impl` blocks in the current crate.
|
/// Return all `impl` blocks in the current crate.
|
||||||
query all_local_trait_impls(_: ()) -> &'tcx BTreeMap<DefId, Vec<LocalDefId>> {
|
query all_local_trait_impls(_: ()) -> &'tcx rustc_data_structures::fx::FxIndexMap<DefId, Vec<LocalDefId>> {
|
||||||
desc { "local trait impls" }
|
desc { "local trait impls" }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,7 @@ use crate::ty::subst::{GenericArg, InternalSubsts, Subst, SubstsRef};
|
||||||
use crate::ty::util::Discr;
|
use crate::ty::util::Discr;
|
||||||
use rustc_ast as ast;
|
use rustc_ast as ast;
|
||||||
use rustc_attr as attr;
|
use rustc_attr as attr;
|
||||||
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
|
use rustc_data_structures::fx::{FxHashMap, FxHashSet, FxIndexMap};
|
||||||
use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
|
use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
|
||||||
use rustc_data_structures::tagged_ptr::CopyTaggedPtr;
|
use rustc_data_structures::tagged_ptr::CopyTaggedPtr;
|
||||||
use rustc_hir as hir;
|
use rustc_hir as hir;
|
||||||
|
@ -43,7 +43,6 @@ use rustc_span::{sym, Span};
|
||||||
use rustc_target::abi::Align;
|
use rustc_target::abi::Align;
|
||||||
|
|
||||||
use std::cmp::Ordering;
|
use std::cmp::Ordering;
|
||||||
use std::collections::BTreeMap;
|
|
||||||
use std::hash::{Hash, Hasher};
|
use std::hash::{Hash, Hasher};
|
||||||
use std::ops::ControlFlow;
|
use std::ops::ControlFlow;
|
||||||
use std::{fmt, ptr, str};
|
use std::{fmt, ptr, str};
|
||||||
|
@ -136,7 +135,7 @@ pub struct ResolverOutputs {
|
||||||
/// via `extern crate` item and not `--extern` option or compiler built-in.
|
/// via `extern crate` item and not `--extern` option or compiler built-in.
|
||||||
pub extern_prelude: FxHashMap<Symbol, bool>,
|
pub extern_prelude: FxHashMap<Symbol, bool>,
|
||||||
pub main_def: Option<MainDefinition>,
|
pub main_def: Option<MainDefinition>,
|
||||||
pub trait_impls: BTreeMap<DefId, Vec<LocalDefId>>,
|
pub trait_impls: FxIndexMap<DefId, Vec<LocalDefId>>,
|
||||||
/// A list of proc macro LocalDefIds, written out in the order in which
|
/// A list of proc macro LocalDefIds, written out in the order in which
|
||||||
/// they are declared in the static array generated by proc_macro_harness.
|
/// they are declared in the static array generated by proc_macro_harness.
|
||||||
pub proc_macros: Vec<LocalDefId>,
|
pub proc_macros: Vec<LocalDefId>,
|
||||||
|
|
|
@ -56,7 +56,6 @@ use rustc_ast as ast;
|
||||||
use rustc_attr as attr;
|
use rustc_attr as attr;
|
||||||
use rustc_span::symbol::Symbol;
|
use rustc_span::symbol::Symbol;
|
||||||
use rustc_span::{Span, DUMMY_SP};
|
use rustc_span::{Span, DUMMY_SP};
|
||||||
use std::collections::BTreeMap;
|
|
||||||
use std::ops::Deref;
|
use std::ops::Deref;
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
|
@ -68,7 +68,7 @@ use rustc_span::{Span, DUMMY_SP};
|
||||||
|
|
||||||
use smallvec::{smallvec, SmallVec};
|
use smallvec::{smallvec, SmallVec};
|
||||||
use std::cell::{Cell, RefCell};
|
use std::cell::{Cell, RefCell};
|
||||||
use std::collections::{BTreeMap, BTreeSet};
|
use std::collections::BTreeSet;
|
||||||
use std::ops::ControlFlow;
|
use std::ops::ControlFlow;
|
||||||
use std::{cmp, fmt, iter, mem, ptr};
|
use std::{cmp, fmt, iter, mem, ptr};
|
||||||
use tracing::debug;
|
use tracing::debug;
|
||||||
|
@ -1061,7 +1061,7 @@ pub struct Resolver<'a> {
|
||||||
item_generics_num_lifetimes: FxHashMap<LocalDefId, usize>,
|
item_generics_num_lifetimes: FxHashMap<LocalDefId, usize>,
|
||||||
|
|
||||||
main_def: Option<MainDefinition>,
|
main_def: Option<MainDefinition>,
|
||||||
trait_impls: BTreeMap<DefId, Vec<LocalDefId>>,
|
trait_impls: FxIndexMap<DefId, Vec<LocalDefId>>,
|
||||||
/// A list of proc macro LocalDefIds, written out in the order in which
|
/// A list of proc macro LocalDefIds, written out in the order in which
|
||||||
/// they are declared in the static array generated by proc_macro_harness.
|
/// they are declared in the static array generated by proc_macro_harness.
|
||||||
proc_macros: Vec<NodeId>,
|
proc_macros: Vec<NodeId>,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue