diff options
| author | IQuant <quant3234@gmail.com> | 2023-03-09 21:59:40 +0300 |
|---|---|---|
| committer | IQuant <quant3234@gmail.com> | 2023-04-04 18:50:07 +0300 |
| commit | 6a05cd85adf99445a9064a0bbc71b507fcb3856e (patch) | |
| tree | bea0fb2786e6631dd35fc9b52f7e836d07491561 /compiler/rustc_infer/src/errors | |
| parent | fd18d9a584230ad696302157dac1a1a38f1bda31 (diff) | |
A more general implementation of `IntoDiagnosticArg` for `Binder` (Also removes `DiagArg`, as it's no longer necessary)
Diffstat (limited to 'compiler/rustc_infer/src/errors')
| -rw-r--r-- | compiler/rustc_infer/src/errors/mod.rs | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/compiler/rustc_infer/src/errors/mod.rs b/compiler/rustc_infer/src/errors/mod.rs index 2a5d3516c28..b129621130d 100644 --- a/compiler/rustc_infer/src/errors/mod.rs +++ b/compiler/rustc_infer/src/errors/mod.rs @@ -1146,14 +1146,6 @@ pub struct OpaqueCapturesLifetime<'tcx> { pub opaque_ty: Ty<'tcx>, } -pub struct DiagArg<T>(pub T); - -impl<T: ToString> IntoDiagnosticArg for DiagArg<T> { - fn into_diagnostic_arg(self) -> rustc_errors::DiagnosticArgValue<'static> { - self.0.to_string().into_diagnostic_arg() - } -} - #[derive(Subdiagnostic)] pub enum FunctionPointerSuggestion<'a> { #[suggestion( @@ -1221,7 +1213,7 @@ pub enum FunctionPointerSuggestion<'a> { fn_name: String, #[skip_arg] found_sig: Binder<'a, FnSig<'a>>, - expected_sig: DiagArg<Binder<'a, FnSig<'a>>>, + expected_sig: Binder<'a, FnSig<'a>>, }, #[suggestion( infer_fps_cast_both, @@ -1236,7 +1228,7 @@ pub enum FunctionPointerSuggestion<'a> { fn_name: String, #[skip_arg] found_sig: Binder<'a, FnSig<'a>>, - expected_sig: DiagArg<Binder<'a, FnSig<'a>>>, + expected_sig: Binder<'a, FnSig<'a>>, }, } |
