diff options
| author | John Kåre Alsaker <john.kare.alsaker@gmail.com> | 2018-06-06 22:13:52 +0200 |
|---|---|---|
| committer | John Kåre Alsaker <john.kare.alsaker@gmail.com> | 2019-01-11 03:53:29 +0100 |
| commit | 69d18a398656f41ff713b26cc8a0149635a8eea2 (patch) | |
| tree | 8731c660d4e1662fcbc24f0fb18598592adf4f45 /src/librustc/ty/query | |
| parent | c2d381d39d282c0586d50ea7d7a431ffd5ddb3fb (diff) | |
| download | rust-69d18a398656f41ff713b26cc8a0149635a8eea2.tar.gz rust-69d18a398656f41ff713b26cc8a0149635a8eea2.zip | |
Make more passes incremental
Diffstat (limited to 'src/librustc/ty/query')
| -rw-r--r-- | src/librustc/ty/query/config.rs | 47 | ||||
| -rw-r--r-- | src/librustc/ty/query/mod.rs | 12 | ||||
| -rw-r--r-- | src/librustc/ty/query/plumbing.rs | 5 |
3 files changed, 63 insertions, 1 deletions
diff --git a/src/librustc/ty/query/config.rs b/src/librustc/ty/query/config.rs index 3464464aa22..ca5d1f6bd32 100644 --- a/src/librustc/ty/query/config.rs +++ b/src/librustc/ty/query/config.rs @@ -68,11 +68,56 @@ impl<'tcx, M: QueryAccessors<'tcx, Key=DefId>> QueryDescription<'tcx> for M { format!("processing `{}`", tcx.item_path_str(def_id)).into() } else { let name = unsafe { ::std::intrinsics::type_name::<M>() }; - format!("processing `{}` applied to `{:?}`", name, def_id).into() + format!("processing {:?} with query `{}`", def_id, name).into() } } } +impl<'tcx> QueryDescription<'tcx> for queries::check_mod_attrs<'tcx> { + fn describe( + tcx: TyCtxt<'_, '_, '_>, + key: DefId, + ) -> Cow<'static, str> { + format!("checking attributes in {}", key.describe_as_module(tcx)).into() + } +} + +impl<'tcx> QueryDescription<'tcx> for queries::check_mod_unstable_api_usage<'tcx> { + fn describe( + tcx: TyCtxt<'_, '_, '_>, + key: DefId, + ) -> Cow<'static, str> { + format!("checking for unstable API usage in {}", key.describe_as_module(tcx)).into() + } +} + +impl<'tcx> QueryDescription<'tcx> for queries::check_mod_loops<'tcx> { + fn describe( + tcx: TyCtxt<'_, '_, '_>, + key: DefId, + ) -> Cow<'static, str> { + format!("checking loops in {}", key.describe_as_module(tcx)).into() + } +} + +impl<'tcx> QueryDescription<'tcx> for queries::check_mod_item_types<'tcx> { + fn describe( + tcx: TyCtxt<'_, '_, '_>, + key: DefId, + ) -> Cow<'static, str> { + format!("checking item types in {}", key.describe_as_module(tcx)).into() + } +} + +impl<'tcx> QueryDescription<'tcx> for queries::collect_mod_item_types<'tcx> { + fn describe( + tcx: TyCtxt<'_, '_, '_>, + key: DefId, + ) -> Cow<'static, str> { + format!("collecting item types in {}", key.describe_as_module(tcx)).into() + } +} + impl<'tcx> QueryDescription<'tcx> for queries::normalize_projection_ty<'tcx> { fn describe( _tcx: TyCtxt<'_, '_, '_>, diff --git a/src/librustc/ty/query/mod.rs b/src/librustc/ty/query/mod.rs index d9cabb39574..39d76ceed95 100644 --- a/src/librustc/ty/query/mod.rs +++ b/src/librustc/ty/query/mod.rs @@ -254,6 +254,18 @@ define_queries! { <'tcx> }, Other { + /// Checks the attributes in the module + [] fn check_mod_attrs: CheckModAttrs(DefId) -> (), + + [] fn check_mod_unstable_api_usage: CheckModUnstableApiUsage(DefId) -> (), + + /// Checks the loops in the module + [] fn check_mod_loops: CheckModLoops(DefId) -> (), + + [] fn check_mod_item_types: CheckModItemTypes(DefId) -> (), + + [] fn collect_mod_item_types: CollectModItemTypes(DefId) -> (), + /// Caches CoerceUnsized kinds for impls on custom types. [] fn coerce_unsized_info: CoerceUnsizedInfo(DefId) -> ty::adjustment::CoerceUnsizedInfo, diff --git a/src/librustc/ty/query/plumbing.rs b/src/librustc/ty/query/plumbing.rs index 2d619d19b42..af23bf3c590 100644 --- a/src/librustc/ty/query/plumbing.rs +++ b/src/librustc/ty/query/plumbing.rs @@ -1262,6 +1262,11 @@ pub fn force_from_dep_node<'a, 'gcx, 'lcx>(tcx: TyCtxt<'a, 'gcx, 'lcx>, DepKind::MirBorrowCheck => { force!(mir_borrowck, def_id!()); } DepKind::UnsafetyCheckResult => { force!(unsafety_check_result, def_id!()); } DepKind::UnsafeDeriveOnReprPacked => { force!(unsafe_derive_on_repr_packed, def_id!()); } + DepKind::CheckModAttrs => { force!(check_mod_attrs, def_id!()); } + DepKind::CheckModLoops => { force!(check_mod_loops, def_id!()); } + DepKind::CheckModUnstableApiUsage => { force!(check_mod_unstable_api_usage, def_id!()); } + DepKind::CheckModItemTypes => { force!(check_mod_item_types, def_id!()); } + DepKind::CollectModItemTypes => { force!(collect_mod_item_types, def_id!()); } DepKind::Reachability => { force!(reachable_set, LOCAL_CRATE); } DepKind::MirKeys => { force!(mir_keys, LOCAL_CRATE); } DepKind::CrateVariances => { force!(crate_variances, LOCAL_CRATE); } |
