Rollup merge of #74376 - lcnr:type-dependent-path-cleanup, r=eddyb

test caching opt_const_param_of on disc

Followup to #74113, implements parts of #74360

Tried caching `opt_const_param_of` on disk and adding an early exit if `tcx.dep_kind(def_id) != DefKind::AnonConst`.

Ended up causing a perf regression instead, so we just remove the FIXME and a short note to `opt_const_param_of`.

r? @eddyb
This commit is contained in:
Manish Goregaokar 2020-07-20 12:30:20 -07:00 committed by GitHub
commit 6a4276d30c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -103,9 +103,13 @@ rustc_queries! {
/// // ^ While calling `opt_const_param_of` for other bodies returns `None`.
/// }
/// ```
// It looks like caching this query on disk actually slightly
// worsened performance in #74376.
//
// Once const generics are more prevalently used, we might want to
// consider only caching calls returning `Some`.
query opt_const_param_of(key: LocalDefId) -> Option<DefId> {
desc { |tcx| "computing the optional const parameter of `{}`", tcx.def_path_str(key.to_def_id()) }
// FIXME(#74113): consider storing this query on disk.
}
/// Records the type of every item.