about summary refs log tree commit diff
path: root/compiler/rustc_query_impl/src/lib.rs
diff options
context:
space:
mode:
authorJohn Kåre Alsaker <john.kare.alsaker@gmail.com>2023-03-26 12:24:44 +0200
committerJohn Kåre Alsaker <john.kare.alsaker@gmail.com>2023-04-06 08:25:53 +0200
commit6d99dd91895f9dafbaa08d1ada7782d884089503 (patch)
tree83c9e369b3589a4b45da6bafb64390b524536db8 /compiler/rustc_query_impl/src/lib.rs
parent453e919c3748c2e057d4e2c3fc3b881ac84668c9 (diff)
downloadrust-6d99dd91895f9dafbaa08d1ada7782d884089503.tar.gz
rust-6d99dd91895f9dafbaa08d1ada7782d884089503.zip
Address comments
Diffstat (limited to 'compiler/rustc_query_impl/src/lib.rs')
-rw-r--r--compiler/rustc_query_impl/src/lib.rs9
1 files changed, 4 insertions, 5 deletions
diff --git a/compiler/rustc_query_impl/src/lib.rs b/compiler/rustc_query_impl/src/lib.rs
index 7e053735aa9..7001a1eed57 100644
--- a/compiler/rustc_query_impl/src/lib.rs
+++ b/compiler/rustc_query_impl/src/lib.rs
@@ -45,12 +45,11 @@ pub use on_disk_cache::OnDiskCache;
 mod profiling_support;
 pub use self::profiling_support::alloc_self_profile_query_strings;
 
-trait QueryToConfig<'tcx>: 'tcx {
-    type Value;
-    type Config: QueryConfig<QueryCtxt<'tcx>>;
+/// This is implemented per query and restoring query values from their erased state.
+trait QueryConfigRestored<'tcx>: QueryConfig<QueryCtxt<'tcx>> + Default {
+    type RestoredValue;
 
-    fn config(qcx: QueryCtxt<'tcx>) -> Self::Config;
-    fn restore(value: <Self::Config as QueryConfig<QueryCtxt<'tcx>>>::Value) -> Self::Value;
+    fn restore(value: <Self as QueryConfig<QueryCtxt<'tcx>>>::Value) -> Self::RestoredValue;
 }
 
 rustc_query_append! { define_queries! }