From 3cee5c8d77371e3ab47663b558bf1c637bbbee7c Mon Sep 17 00:00:00 2001 From: bjorn3 <17426603+bjorn3@users.noreply.github.com> Date: Wed, 4 Feb 2026 12:59:06 +0000 Subject: [PATCH 1/3] Hard code the error code registry for custom drivers --- examples/rustc-interface-example.rs | 4 ---- examples/rustc-interface-getting-diagnostics.rs | 3 +-- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/examples/rustc-interface-example.rs b/examples/rustc-interface-example.rs index 360f70c8e8..fe9895d778 100644 --- a/examples/rustc-interface-example.rs +++ b/examples/rustc-interface-example.rs @@ -4,14 +4,12 @@ extern crate rustc_driver; extern crate rustc_error_codes; -extern crate rustc_errors; extern crate rustc_hash; extern crate rustc_hir; extern crate rustc_interface; extern crate rustc_session; extern crate rustc_span; -use rustc_errors::registry; use rustc_hash::FxHashMap; use rustc_session::config; @@ -50,8 +48,6 @@ fn main() { // // The second parameter is local providers and the third parameter is external providers. override_queries: None, // Option, &mut ty::query::Providers<'_>)> - // Registry of diagnostics codes. - registry: registry::Registry::new(rustc_errors::codes::DIAGNOSTICS), make_codegen_backend: None, expanded_args: Vec::new(), ice_file: None, diff --git a/examples/rustc-interface-getting-diagnostics.rs b/examples/rustc-interface-getting-diagnostics.rs index 2512ba3c3f..83b71b351b 100644 --- a/examples/rustc-interface-getting-diagnostics.rs +++ b/examples/rustc-interface-getting-diagnostics.rs @@ -15,7 +15,7 @@ extern crate rustc_span; use std::sync::{Arc, Mutex}; use rustc_errors::emitter::Emitter; -use rustc_errors::registry::{self, Registry}; +use rustc_errors::registry::Registry; use rustc_errors::translation::Translate; use rustc_errors::{DiagInner, FluentBundle}; use rustc_session::config; @@ -76,7 +76,6 @@ fn main() { })), register_lints: None, override_queries: None, - registry: registry::Registry::new(rustc_errors::codes::DIAGNOSTICS), make_codegen_backend: None, expanded_args: Vec::new(), ice_file: None, From 9d2a8c3d8e42b08abc9a1499adca1e48b44736f6 Mon Sep 17 00:00:00 2001 From: Jonathan Brouwer Date: Tue, 10 Feb 2026 09:13:45 +0000 Subject: [PATCH 2/3] Remove SubdiagMessage in favour of the identical DiagMessage --- src/diagnostics/translation.md | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/diagnostics/translation.md b/src/diagnostics/translation.md index 58d75f54a0..e66c943091 100644 --- a/src/diagnostics/translation.md +++ b/src/diagnostics/translation.md @@ -135,8 +135,7 @@ translation. ### Messages All of rustc's traditional diagnostic APIs (e.g. `struct_span_err` or `note`) -take any message that can be converted into a `DiagMessage` (or -`SubdiagMessage`). +take any message that can be converted into a `DiagMessage`. [`rustc_error_messages::DiagMessage`] can represent legacy non-translatable diagnostic messages and translatable messages. Non-translatable messages are @@ -149,14 +148,7 @@ with an attribute). Fluent resource (described in more detail below), or `DiagMessage`s will either be created in the macro-generated code of a diagnostic derive. -`rustc_error_messages::SubdiagMessage` is similar, it can correspond to a -legacy non-translatable diagnostic message or the name of an attribute to a -Fluent message. Translatable `SubdiagMessage`s must be combined with a -`DiagMessage` (using `DiagMessage::with_subdiagnostic_message`) to -be emitted (an attribute name on its own is meaningless without a corresponding -message identifier, which is what `DiagMessage` provides). - -Both `DiagMessage` and `SubdiagMessage` implement `Into` for any +`DiagMessage` implements `Into` for any type that can be converted into a string, and converts these into non-translatable diagnostics - this keeps all existing diagnostic calls working. From 47dcaf9abf4a6566232a2ed4d61b3dbe1b48d201 Mon Sep 17 00:00:00 2001 From: The rustc-josh-sync Cronjob Bot Date: Mon, 16 Feb 2026 04:52:14 +0000 Subject: [PATCH 3/3] Prepare for merging from rust-lang/rust This updates the rust-version file to 139651428df86cf88443295542c12ea617cbb587. --- rust-version | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rust-version b/rust-version index 209f4226ea..b22c6c3869 100644 --- a/rust-version +++ b/rust-version @@ -1 +1 @@ -44e34e1ac6d7e69b40856cf1403d3da145319c30 +139651428df86cf88443295542c12ea617cbb587