diff options
| author | Li Yuanheng <520dhh@gmail.com> | 2022-08-27 11:55:38 +0800 |
|---|---|---|
| committer | Li Yuanheng <520dhh@gmail.com> | 2022-08-31 19:43:23 +0800 |
| commit | 7ce59ebf496590c8b2ba3693c13e981d369add4b (patch) | |
| tree | 77c0a238fc2f183c1d359c4a5fc2597651a6fbb8 /compiler/rustc_query_system | |
| parent | 166aef90fb7936892af5f0f88335e732d207c731 (diff) | |
| download | rust-7ce59ebf496590c8b2ba3693c13e981d369add4b.tar.gz rust-7ce59ebf496590c8b2ba3693c13e981d369add4b.zip | |
SessionDiagnostic for QueryOverflow error
Diffstat (limited to 'compiler/rustc_query_system')
| -rw-r--r-- | compiler/rustc_query_system/src/error.rs | 4 | ||||
| -rw-r--r-- | compiler/rustc_query_system/src/query/mod.rs | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/compiler/rustc_query_system/src/error.rs b/compiler/rustc_query_system/src/error.rs index 9b808afeef6..5f992ec9e21 100644 --- a/compiler/rustc_query_system/src/error.rs +++ b/compiler/rustc_query_system/src/error.rs @@ -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; diff --git a/compiler/rustc_query_system/src/query/mod.rs b/compiler/rustc_query_system/src/query/mod.rs index a1f2b081d43..c6197b9fedb 100644 --- a/compiler/rustc_query_system/src/query/mod.rs +++ b/compiler/rustc_query_system/src/query/mod.rs @@ -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); } } |
