From cfa0b07c8d7e4c63e01549b1b026bb7494a7c4f1 Mon Sep 17 00:00:00 2001 From: Esteban Küber Date: Fri, 27 Dec 2019 04:15:48 -0800 Subject: clean up logic --- src/librustc/query/mod.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/librustc/query') diff --git a/src/librustc/query/mod.rs b/src/librustc/query/mod.rs index 24841a1ccf4..364348e6438 100644 --- a/src/librustc/query/mod.rs +++ b/src/librustc/query/mod.rs @@ -398,6 +398,16 @@ rustc_queries! { typeck_tables.map(|tables| &*tcx.arena.alloc(tables)) } } + query diagnostic_only_typeck_tables_of(key: DefId) -> &'tcx ty::TypeckTables<'tcx> { + cache_on_disk_if { key.is_local() } + load_cached(tcx, id) { + let typeck_tables: Option> = tcx + .queries.on_disk_cache + .try_load_query_result(tcx, id); + + typeck_tables.map(|tables| &*tcx.arena.alloc(tables)) + } + } } Other { -- cgit 1.4.1-3-g733a5