diff options
| author | Camille Gillot <gillot.camille@gmail.com> | 2021-06-01 09:05:22 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-06-01 09:05:22 +0200 |
| commit | 0f0f3138cb80137b9277b29118c05dbff9a8915e (patch) | |
| tree | 4809ba7275fdf021453562db97dc0f0e9a5fd598 /compiler/rustc_ty_utils/src | |
| parent | c9c1f8be3fda5b58520c579451d3f5e20736ec90 (diff) | |
| download | rust-0f0f3138cb80137b9277b29118c05dbff9a8915e.tar.gz rust-0f0f3138cb80137b9277b29118c05dbff9a8915e.zip | |
Revert "Reduce the amount of untracked state in TyCtxt"
Diffstat (limited to 'compiler/rustc_ty_utils/src')
| -rw-r--r-- | compiler/rustc_ty_utils/src/ty.rs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/compiler/rustc_ty_utils/src/ty.rs b/compiler/rustc_ty_utils/src/ty.rs index 07a3132568b..f38c5d8f2f7 100644 --- a/compiler/rustc_ty_utils/src/ty.rs +++ b/compiler/rustc_ty_utils/src/ty.rs @@ -1,11 +1,12 @@ use rustc_data_structures::fx::FxIndexSet; use rustc_hir as hir; -use rustc_hir::def_id::{DefId, LocalDefId}; +use rustc_hir::def_id::{CrateNum, DefId, LocalDefId, LOCAL_CRATE}; use rustc_middle::hir::map as hir_map; use rustc_middle::ty::subst::Subst; use rustc_middle::ty::{ self, Binder, Predicate, PredicateKind, ToPredicate, Ty, TyCtxt, WithConstness, }; +use rustc_span::symbol::Symbol; use rustc_span::Span; use rustc_trait_selection::traits; @@ -387,6 +388,11 @@ fn param_env_reveal_all_normalized(tcx: TyCtxt<'_>, def_id: DefId) -> ty::ParamE tcx.param_env(def_id).with_reveal_all_normalized(tcx) } +fn original_crate_name(tcx: TyCtxt<'_>, crate_num: CrateNum) -> Symbol { + assert_eq!(crate_num, LOCAL_CRATE); + tcx.crate_name +} + fn instance_def_size_estimate<'tcx>( tcx: TyCtxt<'tcx>, instance_def: ty::InstanceDef<'tcx>, @@ -532,6 +538,7 @@ pub fn provide(providers: &mut ty::query::Providers) { param_env, param_env_reveal_all_normalized, trait_of_item, + original_crate_name, instance_def_size_estimate, issue33140_self_ty, impl_defaultness, |
