about summary refs log tree commit diff
path: root/compiler/rustc_macros/src/diagnostics/subdiagnostic.rs
diff options
context:
space:
mode:
authorNicholas Nethercote <n.nethercote@gmail.com>2024-02-06 16:35:19 +1100
committerNicholas Nethercote <n.nethercote@gmail.com>2024-02-08 13:02:44 +1100
commit6b175a848d72f0ea60d80de3bd74d0806a64c40f (patch)
tree453f31160bb5cdf9ad56d2c825c0070640f6c03e /compiler/rustc_macros/src/diagnostics/subdiagnostic.rs
parent0d531351e848ad69a03c704d40985c9003847427 (diff)
downloadrust-6b175a848d72f0ea60d80de3bd74d0806a64c40f.tar.gz
rust-6b175a848d72f0ea60d80de3bd74d0806a64c40f.zip
Add `SubdiagnosticMessageOp` as a trait alias.
It avoids a lot of repetition.
Diffstat (limited to 'compiler/rustc_macros/src/diagnostics/subdiagnostic.rs')
-rw-r--r--compiler/rustc_macros/src/diagnostics/subdiagnostic.rs5
1 files changed, 1 insertions, 4 deletions
diff --git a/compiler/rustc_macros/src/diagnostics/subdiagnostic.rs b/compiler/rustc_macros/src/diagnostics/subdiagnostic.rs
index c029b931e7d..3a5f289559e 100644
--- a/compiler/rustc_macros/src/diagnostics/subdiagnostic.rs
+++ b/compiler/rustc_macros/src/diagnostics/subdiagnostic.rs
@@ -89,10 +89,7 @@ impl SubdiagnosticDeriveBuilder {
             gen impl rustc_errors::AddToDiagnostic for @Self {
                 fn add_to_diagnostic_with<__F>(self, #diag: &mut rustc_errors::Diagnostic, #f: __F)
                 where
-                    __F: core::ops::Fn(
-                        &mut rustc_errors::Diagnostic,
-                        rustc_errors::SubdiagnosticMessage
-                    ) -> rustc_errors::SubdiagnosticMessage,
+                    __F: rustc_errors::SubdiagnosticMessageOp,
                 {
                     #implementation
                 }