From e8d16fdf9f95e4110df53650779be842b6749f60 Mon Sep 17 00:00:00 2001 From: Bastian Kauschke Date: Sat, 18 Jul 2020 19:22:12 +0200 Subject: [PATCH] add note to `opt_const_param_of` --- src/librustc_middle/query/mod.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/librustc_middle/query/mod.rs b/src/librustc_middle/query/mod.rs index 40ff25cf3b134..06136a82e7b46 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 { 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.