X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=compiler%2Frustc_query_impl%2Fsrc%2Fplumbing.rs;h=1e375deb20d1d5d33ffce1525211fadf7fb43511;hb=2c4dc4f494d26bf7df40895e594de3f0aeb24337;hp=274df5b5e5e9415679ffd389b9ab3ee5626c9e18;hpb=09e7bb427e2830791ae08dbc9f69a525620f1929;p=rust.git diff --git a/compiler/rustc_query_impl/src/plumbing.rs b/compiler/rustc_query_impl/src/plumbing.rs index 274df5b5e5e..1e375deb20d 100644 --- a/compiler/rustc_query_impl/src/plumbing.rs +++ b/compiler/rustc_query_impl/src/plumbing.rs @@ -18,6 +18,7 @@ force_query, QueryConfig, QueryContext, QueryDescription, QueryJobId, QueryMap, QuerySideEffects, QueryStackFrame, }; +use rustc_query_system::Value; use std::any::Any; use std::num::NonZeroU64; use thin_vec::ThinVec; @@ -174,21 +175,17 @@ pub fn try_print_query_stack( } macro_rules! handle_cycle_error { - ([][$tcx: expr, $error:expr]) => {{ - $error.emit(); - Value::from_cycle_error($tcx) + ([]) => {{ + rustc_query_system::HandleCycleError::Error }}; - ([(fatal_cycle) $($rest:tt)*][$tcx:expr, $error:expr]) => {{ - $error.emit(); - $tcx.sess.abort_if_errors(); - unreachable!() + ([(fatal_cycle) $($rest:tt)*]) => {{ + rustc_query_system::HandleCycleError::Fatal }}; - ([(cycle_delay_bug) $($rest:tt)*][$tcx:expr, $error:expr]) => {{ - $error.delay_as_bug(); - Value::from_cycle_error($tcx) + ([(cycle_delay_bug) $($rest:tt)*]) => {{ + rustc_query_system::HandleCycleError::DelayBug }}; - ([$other:tt $($modifiers:tt)*][$($args:tt)*]) => { - handle_cycle_error!([$($modifiers)*][$($args)*]) + ([$other:tt $($modifiers:tt)*]) => { + handle_cycle_error!([$($modifiers)*]) }; } @@ -320,6 +317,7 @@ fn force_from_dep_node<'tcx, Q>(tcx: TyCtxt<'tcx>, dep_node: DepNode) -> bool where Q: QueryDescription>, Q::Key: DepNodeParams>, + Q::Value: Value>, { if let Some(key) = Q::Key::recover(tcx, &dep_node) { #[cfg(debug_assertions)] @@ -418,7 +416,7 @@ fn make_vtable(tcx: QueryCtxt<'tcx>, key: &Self::Key) -> depth_limit: depth_limit!([$($modifiers)*]), dep_kind: dep_graph::DepKind::$name, hash_result: hash_result!([$($modifiers)*]), - handle_cycle_error: |tcx, mut error| handle_cycle_error!([$($modifiers)*][tcx, error]), + handle_cycle_error: handle_cycle_error!([$($modifiers)*]), compute, cache_on_disk, try_load_from_disk: Self::TRY_LOAD_FROM_DISK,