Skip to content

Commit 6a4276d

Browse files
authored
Rollup merge of rust-lang#74376 - lcnr:type-dependent-path-cleanup, r=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
2 parents 991da05 + e8d16fd commit 6a4276d

File tree

1 file changed

+5
-1
lines changed
  • src/librustc_middle/query

1 file changed

+5
-1
lines changed

src/librustc_middle/query/mod.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -103,9 +103,13 @@ rustc_queries! {
103103
/// // ^ While calling `opt_const_param_of` for other bodies returns `None`.
104104
/// }
105105
/// ```
106+
// It looks like caching this query on disk actually slightly
107+
// worsened performance in #74376.
108+
//
109+
// Once const generics are more prevalently used, we might want to
110+
// consider only caching calls returning `Some`.
106111
query opt_const_param_of(key: LocalDefId) -> Option<DefId> {
107112
desc { |tcx| "computing the optional const parameter of `{}`", tcx.def_path_str(key.to_def_id()) }
108-
// FIXME(#74113): consider storing this query on disk.
109113
}
110114

111115
/// Records the type of every item.

0 commit comments

Comments
 (0)