Skip to content

Commit 97d831d

Browse files
committed
Show which type was not specialized on query cycle misuse
1 parent d6b82ff commit 97d831d

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

compiler/rustc_query_system/src/values.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,13 @@ pub trait Value<Tcx: DepContext, D: DepKind>: Sized {
66
}
77

88
impl<Tcx: DepContext, T, D: DepKind> Value<Tcx, D> for T {
9-
default fn from_cycle_error(tcx: Tcx, _: &[QueryInfo<D>]) -> T {
9+
default fn from_cycle_error(tcx: Tcx, cycle: &[QueryInfo<D>]) -> T {
1010
tcx.sess().abort_if_errors();
1111
// Ideally we would use `bug!` here. But bug! is only defined in rustc_middle, and it's
1212
// non-trivial to define it earlier.
13-
panic!("Value::from_cycle_error called without errors");
13+
panic!(
14+
"<{} as Value>::from_cycle_error called without errors: {cycle:#?}",
15+
std::any::type_name::<T>()
16+
);
1417
}
1518
}

0 commit comments

Comments
 (0)