1
Fork 0

SessionDiagnostic for QueryOverflow error

This commit is contained in:
Li Yuanheng 2022-08-27 11:55:38 +08:00
parent 166aef90fb
commit 7ce59ebf49
4 changed files with 8 additions and 2 deletions

View file

@ -67,3 +67,7 @@ pub struct IncrementCompilation {
pub run_cmd: String,
pub dep_node: String,
}
#[derive(SessionDiagnostic)]
#[diag(query_system::query_overflow)]
pub struct QueryOverflow;

View file

@ -125,6 +125,6 @@ pub trait QueryContext: HasDepContext {
) -> R;
fn depth_limit_error(&self) {
self.dep_context().sess().fatal("queries overflow the depth limit!");
self.dep_context().sess().emit_fatal(crate::error::QueryOverflow);
}
}