diff options
| author | Manish Goregaokar <manishsmail@gmail.com> | 2020-07-20 12:30:20 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-07-20 12:30:20 -0700 |
| commit | 6a4276d30c87233bc6dad983ae91c7a9181fc91a (patch) | |
| tree | a01de942cdffd0eabfdc67e86ade802d59ee3dce | |
| parent | 991da05c32c98ec58f2f312b6dca96d998dbaf34 (diff) | |
| parent | e8d16fdf9f95e4110df53650779be842b6749f60 (diff) | |
| download | rust-6a4276d30c87233bc6dad983ae91c7a9181fc91a.tar.gz rust-6a4276d30c87233bc6dad983ae91c7a9181fc91a.zip | |
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
| -rw-r--r-- | src/librustc_middle/query/mod.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/librustc_middle/query/mod.rs b/src/librustc_middle/query/mod.rs index 4dd8723bd72..f479a030d63 100644 --- a/src/librustc_middle/query/mod.rs +++ b/src/librustc_middle/query/mod.rs @@ -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. |
