1 use crate::dep_graph::{DepContext, DepKind};
2 use crate::query::QueryInfo;
4 pub trait Value<Tcx: DepContext, D: DepKind>: Sized {
5 fn from_cycle_error(tcx: Tcx, cycle: &[QueryInfo<D>]) -> Self;
8 impl<Tcx: DepContext, T, D: DepKind> Value<Tcx, D> for T {
9 default fn from_cycle_error(tcx: Tcx, _: &[QueryInfo<D>]) -> T {
10 tcx.sess().abort_if_errors();
11 // Ideally we would use `bug!` here. But bug! is only defined in rustc_middle, and it's
12 // non-trivial to define it earlier.
13 panic!("Value::from_cycle_error called without errors");