From c96d0bff949ef6faed3bc5ab26b4530c2c27cc42 Mon Sep 17 00:00:00 2001 From: Michael Woerister Date: Fri, 29 Sep 2017 11:13:18 +0200 Subject: [PATCH] incr.comp.: Fix some merge fallout. --- src/librustc/ty/maps/plumbing.rs | 2 +- src/librustc_incremental/persist/load.rs | 7 +++++++ src/librustc_trans/base.rs | 2 -- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/librustc/ty/maps/plumbing.rs b/src/librustc/ty/maps/plumbing.rs index d65fbb8f6cf..81b9231aa4f 100644 --- a/src/librustc/ty/maps/plumbing.rs +++ b/src/librustc/ty/maps/plumbing.rs @@ -651,7 +651,7 @@ pub fn force_from_dep_node<'a, 'gcx, 'lcx>(tcx: TyCtxt<'a, 'gcx, 'lcx>, profq_msg!(tcx, ProfileQueriesMsg::QueryBegin( - span.clone(), + span.data(), ::ty::maps::QueryMsg::$query(profq_key!(tcx, $key)) ) ); diff --git a/src/librustc_incremental/persist/load.rs b/src/librustc_incremental/persist/load.rs index ab2630d6a17..cdfc9f2edc3 100644 --- a/src/librustc_incremental/persist/load.rs +++ b/src/librustc_incremental/persist/load.rs @@ -33,6 +33,13 @@ pub fn dep_graph_tcx_init<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>) { tcx.allocate_metadata_dep_nodes(); tcx.precompute_in_scope_traits_hashes(); + if tcx.sess.incr_comp_session_dir_opt().is_none() { + // If we are only building with -Zquery-dep-graph but without an actual + // incr. comp. session directory, we exit here. Otherwise we'd fail + // when trying to load work products. + return + } + let work_products_path = work_products_path(tcx.sess); if let Some(work_products_data) = load_data(tcx.sess, &work_products_path) { // Decode the list of work_products diff --git a/src/librustc_trans/base.rs b/src/librustc_trans/base.rs index c9ed17bfaf0..8c39f579b3e 100644 --- a/src/librustc_trans/base.rs +++ b/src/librustc_trans/base.rs @@ -956,8 +956,6 @@ pub fn trans_crate<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, } } - assert!(codegen_units.len() <= 1 || !tcx.sess.lto()); - let ongoing_translation = write::start_async_translation( tcx, time_graph.clone(),