]> git.lizzy.rs Git - rust.git/blob - compiler/rustc_query_system/src/values.rs
Rollup merge of #101861 - wesleywiser:update_stdarch, r=Amanieu
[rust.git] / compiler / rustc_query_system / src / values.rs
1 use crate::dep_graph::DepContext;
2
3 pub trait Value<CTX: DepContext>: Sized {
4     fn from_cycle_error(tcx: CTX) -> Self;
5 }
6
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");
13     }
14 }