1
Fork 0

Pass ErrorGuaranteed to cycle error

This commit is contained in:
Michael Goulet 2023-08-27 21:32:55 +00:00
parent 668bf8c593
commit e7b3c94b0e
7 changed files with 59 additions and 24 deletions

View file

@ -41,7 +41,7 @@ use rustc_query_system::query::{
};
use rustc_query_system::HandleCycleError;
use rustc_query_system::Value;
use rustc_span::Span;
use rustc_span::{ErrorGuaranteed, Span};
#[macro_use]
mod plumbing;
@ -146,8 +146,9 @@ where
self,
tcx: TyCtxt<'tcx>,
cycle: &[QueryInfo<DepKind>],
guar: ErrorGuaranteed,
) -> Self::Value {
(self.dynamic.value_from_cycle_error)(tcx, cycle)
(self.dynamic.value_from_cycle_error)(tcx, cycle, guar)
}
#[inline(always)]

View file

@ -605,8 +605,8 @@ macro_rules! define_queries {
} {
|_tcx, _key, _prev_index, _index| None
}),
value_from_cycle_error: |tcx, cycle| {
let result: queries::$name::Value<'tcx> = Value::from_cycle_error(tcx, cycle);
value_from_cycle_error: |tcx, cycle, guar| {
let result: queries::$name::Value<'tcx> = Value::from_cycle_error(tcx, cycle, guar);
erase(result)
},
loadable_from_disk: |_tcx, _key, _index| {