about summary refs log tree commit diff
path: root/compiler/rustc_errors/src
diff options
context:
space:
mode:
authorOli Scherer <git-spam-no-reply9815368754983@oli-obk.de>2024-06-18 11:10:18 +0000
committerOli Scherer <git-spam-no-reply9815368754983@oli-obk.de>2024-06-18 15:42:11 +0000
commit3f34196839730cfb5b241667cfcc9b94599ea0c1 (patch)
tree80ece39632f7158170271228cab2199e5f54d0e0 /compiler/rustc_errors/src
parent7ba82d61eb519c9c8cb8c47a3030a2bd2faaa186 (diff)
downloadrust-3f34196839730cfb5b241667cfcc9b94599ea0c1.tar.gz
rust-3f34196839730cfb5b241667cfcc9b94599ea0c1.zip
Remove redundant argument from `subdiagnostic` method
Diffstat (limited to 'compiler/rustc_errors/src')
-rw-r--r--compiler/rustc_errors/src/diagnostic.rs7
1 files changed, 2 insertions, 5 deletions
diff --git a/compiler/rustc_errors/src/diagnostic.rs b/compiler/rustc_errors/src/diagnostic.rs
index c03dccdb325..e580910af77 100644
--- a/compiler/rustc_errors/src/diagnostic.rs
+++ b/compiler/rustc_errors/src/diagnostic.rs
@@ -1192,11 +1192,8 @@ impl<'a, G: EmissionGuarantee> Diag<'a, G> {
     /// used in the subdiagnostic, so suitable for use with repeated messages (i.e. re-use of
     /// interpolated variables).
     #[rustc_lint_diagnostics]
-    pub fn subdiagnostic(
-        &mut self,
-        dcx: DiagCtxtHandle<'_>,
-        subdiagnostic: impl Subdiagnostic,
-    ) -> &mut Self {
+    pub fn subdiagnostic(&mut self, subdiagnostic: impl Subdiagnostic) -> &mut Self {
+        let dcx = self.dcx;
         subdiagnostic.add_to_diag_with(self, &|diag, msg| {
             let args = diag.args.iter();
             let msg = diag.subdiagnostic_message_to_diagnostic_message(msg);