separate definitions and HIR
owners
fix a ui test use `into` fix clippy ui test fix a run-make-fulldeps test implement `IntoQueryParam<DefId>` for `OwnerId` use `OwnerId` for more queries change the type of `ParentOwnerIterator::Item` to `(OwnerId, OwnerNode)`
This commit is contained in:
parent
bb5a016175
commit
8fe936099a
114 changed files with 659 additions and 518 deletions
|
@ -1,6 +1,7 @@
|
|||
//! Defines the set of legal keys that can be used in queries.
|
||||
|
||||
use rustc_hir::def_id::{CrateNum, DefId, LocalDefId, LOCAL_CRATE};
|
||||
use rustc_hir::hir_id::OwnerId;
|
||||
use rustc_middle::infer::canonical::Canonical;
|
||||
use rustc_middle::mir;
|
||||
use rustc_middle::traits;
|
||||
|
@ -104,6 +105,19 @@ impl Key for CrateNum {
|
|||
}
|
||||
}
|
||||
|
||||
impl Key for OwnerId {
|
||||
#[inline(always)]
|
||||
fn query_crate_is_local(&self) -> bool {
|
||||
true
|
||||
}
|
||||
fn default_span(&self, tcx: TyCtxt<'_>) -> Span {
|
||||
self.to_def_id().default_span(tcx)
|
||||
}
|
||||
fn key_as_def_id(&self) -> Option<DefId> {
|
||||
Some(self.to_def_id())
|
||||
}
|
||||
}
|
||||
|
||||
impl Key for LocalDefId {
|
||||
#[inline(always)]
|
||||
fn query_crate_is_local(&self) -> bool {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue