Auto merge of #120006 - cjgillot:no-hir-owner, r=wesleywiser
Get rid of the hir_owner query. This query was meant as a firewall between `hir_owner_nodes` which is supposed to change often, and the queries that only depend on the item signature. That firewall was inefficient, leaking the contents of the HIR body through `HirId`s. `hir_owner` incurs a significant cost, as we need to hash HIR twice in multiple modes. This PR proposes to remove it, and simplify the hashing scheme. For the future, `def_kind`, `def_span`... are much more efficient for incremental decoupling, and should be preferred.
This commit is contained in:
commit
d3c9082a44
30 changed files with 581 additions and 716 deletions
|
@ -164,10 +164,6 @@ impl<T> EraseType for Option<&'_ [T]> {
|
|||
type Result = [u8; size_of::<Option<&'static [()]>>()];
|
||||
}
|
||||
|
||||
impl EraseType for Option<rustc_middle::hir::Owner<'_>> {
|
||||
type Result = [u8; size_of::<Option<rustc_middle::hir::Owner<'static>>>()];
|
||||
}
|
||||
|
||||
impl EraseType for Option<mir::DestructuredConstant<'_>> {
|
||||
type Result = [u8; size_of::<Option<mir::DestructuredConstant<'static>>>()];
|
||||
}
|
||||
|
@ -324,7 +320,6 @@ macro_rules! tcx_lifetime {
|
|||
}
|
||||
|
||||
tcx_lifetime! {
|
||||
rustc_middle::hir::Owner,
|
||||
rustc_middle::middle::exported_symbols::ExportedSymbol,
|
||||
rustc_middle::mir::Const,
|
||||
rustc_middle::mir::DestructuredConstant,
|
||||
|
|
|
@ -174,14 +174,6 @@ rustc_queries! {
|
|||
cache_on_disk_if { true }
|
||||
}
|
||||
|
||||
/// Gives access to the HIR node for the HIR owner `key`.
|
||||
///
|
||||
/// This can be conveniently accessed by methods on `tcx.hir()`.
|
||||
/// Avoid calling this query directly.
|
||||
query hir_owner(key: hir::OwnerId) -> Option<crate::hir::Owner<'tcx>> {
|
||||
desc { |tcx| "getting HIR owner of `{}`", tcx.def_path_str(key) }
|
||||
}
|
||||
|
||||
/// Gives access to the HIR ID for the given `LocalDefId` owner `key` if any.
|
||||
///
|
||||
/// Definitions that were generated with no HIR, would be fed to return `None`.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue