diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2024-02-08 09:06:36 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-02-08 09:06:36 +0100 |
| commit | 87e1e05aa1185125c4380bc77965b3d50f506c60 (patch) | |
| tree | 0eb3e805f41420c9cfe330eeaae600abb4d0ea48 /compiler/rustc_pattern_analysis/src | |
| parent | 5157190008f4e285e825b1eeefa0e9b171d1f5e9 (diff) | |
| parent | 6b175a848d72f0ea60d80de3bd74d0806a64c40f (diff) | |
| download | rust-87e1e05aa1185125c4380bc77965b3d50f506c60.tar.gz rust-87e1e05aa1185125c4380bc77965b3d50f506c60.zip | |
Rollup merge of #120734 - nnethercote:SubdiagnosticMessageOp, r=compiler-errors
Add `SubdiagnosticMessageOp` as a trait alias. It avoids a lot of repetition. r? matthewjasper
Diffstat (limited to 'compiler/rustc_pattern_analysis/src')
| -rw-r--r-- | compiler/rustc_pattern_analysis/src/errors.rs | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/compiler/rustc_pattern_analysis/src/errors.rs b/compiler/rustc_pattern_analysis/src/errors.rs index bdb6cf19eac..2dffdc9846c 100644 --- a/compiler/rustc_pattern_analysis/src/errors.rs +++ b/compiler/rustc_pattern_analysis/src/errors.rs @@ -1,4 +1,4 @@ -use rustc_errors::{AddToDiagnostic, Diagnostic, SubdiagnosticMessage}; +use rustc_errors::{AddToDiagnostic, Diagnostic, SubdiagnosticMessageOp}; use rustc_macros::{LintDiagnostic, Subdiagnostic}; use rustc_middle::thir::Pat; use rustc_middle::ty::Ty; @@ -62,10 +62,7 @@ pub struct Overlap<'tcx> { } impl<'tcx> AddToDiagnostic for Overlap<'tcx> { - fn add_to_diagnostic_with<F>(self, diag: &mut Diagnostic, _: F) - where - F: Fn(&mut Diagnostic, SubdiagnosticMessage) -> SubdiagnosticMessage, - { + fn add_to_diagnostic_with<F: SubdiagnosticMessageOp>(self, diag: &mut Diagnostic, _: F) { let Overlap { span, range } = self; // FIXME(mejrs) unfortunately `#[derive(LintDiagnostic)]` |
