1 use crate::dep_graph::DepContext;
3 pub trait Value<CTX: DepContext>: Sized {
4 fn from_cycle_error(tcx: CTX) -> Self;
7 impl<CTX: DepContext, T> Value<CTX> for T {
8 default fn from_cycle_error(tcx: CTX) -> T {
9 tcx.sess().abort_if_errors();
10 // Ideally we would use `bug!` here. But bug! is only defined in rustc_middle, and it's
11 // non-trivial to define it earlier.
12 panic!("Value::from_cycle_error called without errors");