1
Fork 0

Remove redundant argument from subdiagnostic method

This commit is contained in:
Oli Scherer 2024-06-18 11:10:18 +00:00
parent 7ba82d61eb
commit 3f34196839
38 changed files with 361 additions and 542 deletions

View file

@ -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);