diff options
| author | Zalathar <Zalathar@users.noreply.github.com> | 2024-07-28 15:12:14 +1000 |
|---|---|---|
| committer | Zalathar <Zalathar@users.noreply.github.com> | 2024-07-28 21:58:44 +1000 |
| commit | e1fc4a997ddac2b949ef6bb4037f1fb196c44f08 (patch) | |
| tree | bd3a0d1949705432a4fe0949eb76a0b756055301 /compiler/rustc_middle/src | |
| parent | 3148b35f6a6226548929c12da529ab0d1a4b47d5 (diff) | |
| download | rust-e1fc4a997ddac2b949ef6bb4037f1fb196c44f08.tar.gz rust-e1fc4a997ddac2b949ef6bb4037f1fb196c44f08.zip | |
Don't store `thir::Pat` in error structs
In several cases this avoids the need to clone the underlying pattern, and then print the clone later.
Diffstat (limited to 'compiler/rustc_middle/src')
| -rw-r--r-- | compiler/rustc_middle/src/thir.rs | 7 |
1 files changed, 0 insertions, 7 deletions
diff --git a/compiler/rustc_middle/src/thir.rs b/compiler/rustc_middle/src/thir.rs index b80d00719ee..1300a06f375 100644 --- a/compiler/rustc_middle/src/thir.rs +++ b/compiler/rustc_middle/src/thir.rs @@ -9,7 +9,6 @@ //! [rustc dev guide]: https://rustc-dev-guide.rust-lang.org/thir.html use rustc_ast::{InlineAsmOptions, InlineAsmTemplatePiece}; -use rustc_errors::{DiagArgValue, IntoDiagArg}; use rustc_hir as hir; use rustc_hir::def_id::DefId; use rustc_hir::{BindingMode, ByRef, HirId, MatchSource, RangeEnd}; @@ -702,12 +701,6 @@ impl<'tcx> Pat<'tcx> { } } -impl<'tcx> IntoDiagArg for Pat<'tcx> { - fn into_diag_arg(self) -> DiagArgValue { - format!("{self}").into_diag_arg() - } -} - #[derive(Clone, Debug, HashStable, TypeVisitable)] pub struct Ascription<'tcx> { pub annotation: CanonicalUserTypeAnnotation<'tcx>, |
