Skip to content

Commit

Permalink
Rollup merge of rust-lang#74376 - lcnr:type-dependent-path-cleanup, r…
Browse files Browse the repository at this point in the history
…=eddyb

test caching opt_const_param_of on disc

Followup to rust-lang#74113, implements parts of rust-lang#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
  • Loading branch information
Manishearth authored Jul 20, 2020
2 parents 991da05 + e8d16fd commit 6a4276d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/librustc_middle/query/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 6a4276d

Please sign in to comment.