+
+impl<'tcx> QueryDescription<'tcx> for queries::typeck_tables_of<'tcx> {
+ #[inline]
+ fn cache_on_disk(def_id: Self::Key) -> bool {
+ def_id.is_local()
+ }
+
+ fn try_load_from_disk<'a>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
+ id: SerializedDepNodeIndex)
+ -> Option<Self::Value> {
+ let typeck_tables: Option<ty::TypeckTables<'tcx>> = tcx
+ .on_disk_query_result_cache
+ .try_load_query_result(tcx, id);
+
+ typeck_tables.map(|tables| tcx.alloc_tables(tables))
+ }
+}
+