Show which type was not specialized on query cycle misuse
This commit is contained in:
parent
d6b82ff761
commit
97d831d008
@ -6,10 +6,13 @@ pub trait Value<Tcx: DepContext, D: DepKind>: Sized {
|
|||||||
}
|
}
|
||||||
|
|
||||||
impl<Tcx: DepContext, T, D: DepKind> Value<Tcx, D> for T {
|
impl<Tcx: DepContext, T, D: DepKind> Value<Tcx, D> for T {
|
||||||
default fn from_cycle_error(tcx: Tcx, _: &[QueryInfo<D>]) -> T {
|
default fn from_cycle_error(tcx: Tcx, cycle: &[QueryInfo<D>]) -> T {
|
||||||
tcx.sess().abort_if_errors();
|
tcx.sess().abort_if_errors();
|
||||||
// Ideally we would use `bug!` here. But bug! is only defined in rustc_middle, and it's
|
// Ideally we would use `bug!` here. But bug! is only defined in rustc_middle, and it's
|
||||||
// non-trivial to define it earlier.
|
// non-trivial to define it earlier.
|
||||||
panic!("Value::from_cycle_error called without errors");
|
panic!(
|
||||||
|
"<{} as Value>::from_cycle_error called without errors: {cycle:#?}",
|
||||||
|
std::any::type_name::<T>()
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user