diff options
| author | Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de> | 2023-07-04 07:56:54 +0000 |
|---|---|---|
| committer | Oli Scherer <git-spam-no-reply9815368754983@oli-obk.de> | 2023-07-05 07:30:28 +0000 |
| commit | 97d831d008601d02d22cbd1b21c4b45809eabe10 (patch) | |
| tree | ce2dac29276807b30213f1630e09a9a85cc72093 | |
| parent | d6b82ff7615dea4051212e22ca36d722017604f5 (diff) | |
| download | rust-97d831d008601d02d22cbd1b21c4b45809eabe10.tar.gz rust-97d831d008601d02d22cbd1b21c4b45809eabe10.zip | |
Show which type was not specialized on query cycle misuse
| -rw-r--r-- | compiler/rustc_query_system/src/values.rs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/compiler/rustc_query_system/src/values.rs b/compiler/rustc_query_system/src/values.rs index b6e2cfa3dca..ce551078cc0 100644 --- a/compiler/rustc_query_system/src/values.rs +++ b/compiler/rustc_query_system/src/values.rs @@ -6,10 +6,13 @@ pub trait Value<Tcx: DepContext, D: DepKind>: Sized { } 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(); // Ideally we would use `bug!` here. But bug! is only defined in rustc_middle, and it's // 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>() + ); } } |
