diff options
| author | John Kåre Alsaker <john.kare.alsaker@gmail.com> | 2023-03-25 09:46:19 +0100 |
|---|---|---|
| committer | John Kåre Alsaker <john.kare.alsaker@gmail.com> | 2023-04-26 07:46:13 +0200 |
| commit | 66d85438cad26aee7ff0d123739edcc43e16bc4a (patch) | |
| tree | ede9fb4276cd3f05176419c20adeebb84255558e /compiler/rustc_incremental/src | |
| parent | 897a146006d1ceba4aeeffca5640fe1d9024b200 (diff) | |
| download | rust-66d85438cad26aee7ff0d123739edcc43e16bc4a.tar.gz rust-66d85438cad26aee7ff0d123739edcc43e16bc4a.zip | |
Remove QueryEngine trait
Diffstat (limited to 'compiler/rustc_incremental/src')
| -rw-r--r-- | compiler/rustc_incremental/src/persist/load.rs | 10 | ||||
| -rw-r--r-- | compiler/rustc_incremental/src/persist/save.rs | 2 |
2 files changed, 7 insertions, 5 deletions
diff --git a/compiler/rustc_incremental/src/persist/load.rs b/compiler/rustc_incremental/src/persist/load.rs index d5097065dda..ec7fcbdf884 100644 --- a/compiler/rustc_incremental/src/persist/load.rs +++ b/compiler/rustc_incremental/src/persist/load.rs @@ -4,7 +4,7 @@ use crate::errors; use rustc_data_structures::fx::FxHashMap; use rustc_data_structures::memmap::Mmap; use rustc_middle::dep_graph::{SerializedDepGraph, WorkProduct, WorkProductId}; -use rustc_middle::ty::OnDiskCache; +use rustc_middle::query::on_disk_cache::OnDiskCache; use rustc_serialize::opaque::MemDecoder; use rustc_serialize::Decodable; use rustc_session::config::IncrementalStateAssertion; @@ -211,7 +211,7 @@ pub fn load_dep_graph(sess: &Session) -> DepGraphFuture { /// If we are not in incremental compilation mode, returns `None`. /// Otherwise, tries to load the query result cache from disk, /// creating an empty cache if it could not be loaded. -pub fn load_query_result_cache<'a, C: OnDiskCache<'a>>(sess: &'a Session) -> Option<C> { +pub fn load_query_result_cache(sess: &Session) -> Option<OnDiskCache<'_>> { if sess.opts.incremental.is_none() { return None; } @@ -223,7 +223,9 @@ pub fn load_query_result_cache<'a, C: OnDiskCache<'a>>(sess: &'a Session) -> Opt &query_cache_path(sess), sess.is_nightly_build(), ) { - LoadResult::Ok { data: (bytes, start_pos) } => Some(C::new(sess, bytes, start_pos)), - _ => Some(C::new_empty(sess.source_map())), + LoadResult::Ok { data: (bytes, start_pos) } => { + Some(OnDiskCache::new(sess, bytes, start_pos)) + } + _ => Some(OnDiskCache::new_empty(sess.source_map())), } } diff --git a/compiler/rustc_incremental/src/persist/save.rs b/compiler/rustc_incremental/src/persist/save.rs index 27be56eac6f..1441e64e41f 100644 --- a/compiler/rustc_incremental/src/persist/save.rs +++ b/compiler/rustc_incremental/src/persist/save.rs @@ -48,7 +48,7 @@ pub fn save_dep_graph(tcx: TyCtxt<'_>) { move || { sess.time("incr_comp_persist_result_cache", || { // Drop the memory map so that we can remove the file and write to it. - if let Some(odc) = &tcx.on_disk_cache { + if let Some(odc) = &tcx.query_system.on_disk_cache { odc.drop_serialized_data(tcx); } |
