Compute all_traits_impls during resolution.
This commit is contained in:
parent
26eeec0baf
commit
635978041d
8 changed files with 17 additions and 18 deletions
|
@ -170,7 +170,7 @@ pub fn provide(providers: &mut Providers) {
|
|||
}
|
||||
};
|
||||
providers.opt_def_kind = |tcx, def_id| tcx.hir().opt_def_kind(def_id.expect_local());
|
||||
providers.all_local_trait_impls = |tcx, ()| &tcx.hir_crate(()).trait_impls;
|
||||
providers.all_local_trait_impls = |tcx, ()| &tcx.resolutions(()).trait_impls;
|
||||
providers.expn_that_defined = |tcx, id| {
|
||||
let id = id.expect_local();
|
||||
tcx.resolutions(()).definitions.expansion_that_defined(id)
|
||||
|
|
|
@ -44,6 +44,7 @@ use rustc_span::Span;
|
|||
use rustc_target::abi::Align;
|
||||
|
||||
use std::cmp::Ordering;
|
||||
use std::collections::BTreeMap;
|
||||
use std::hash::{Hash, Hasher};
|
||||
use std::ops::ControlFlow;
|
||||
use std::{fmt, ptr, str};
|
||||
|
@ -132,6 +133,7 @@ pub struct ResolverOutputs {
|
|||
/// via `extern crate` item and not `--extern` option or compiler built-in.
|
||||
pub extern_prelude: FxHashMap<Symbol, bool>,
|
||||
pub main_def: Option<MainDefinition>,
|
||||
pub trait_impls: BTreeMap<DefId, Vec<LocalDefId>>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Debug)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue