diff --git a/compiler/rustc_error_messages/locales/en-US/query_system.ftl b/compiler/rustc_error_messages/locales/en-US/query_system.ftl index 7fdecf4f381..167704e46c0 100644 --- a/compiler/rustc_error_messages/locales/en-US/query_system.ftl +++ b/compiler/rustc_error_messages/locales/en-US/query_system.ftl @@ -21,3 +21,5 @@ query_system_cycle_recursive_ty_alias_help2 = see "../locales/en-US/passes.ftl", plugin_impl => "../locales/en-US/plugin_impl.ftl", privacy => "../locales/en-US/privacy.ftl", + query_system => "../locales/en-US/query_system.ftl", save_analysis => "../locales/en-US/save_analysis.ftl", ty_utils => "../locales/en-US/ty_utils.ftl", typeck => "../locales/en-US/typeck.ftl", mir_dataflow => "../locales/en-US/mir_dataflow.ftl", - query_system => "../locales/en-US/query_system.ftl", } pub use fluent_generated::{self as fluent, DEFAULT_LOCALE_RESOURCES}; 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 @@ fn start_query( ) -> 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); } }