From 40402cbadad4f7df9ab7e2f3089a5b038d19f586 Mon Sep 17 00:00:00 2001 From: Nadrieril Date: Wed, 31 Jan 2024 01:29:21 +0100 Subject: Manual `Debug` impls are not needed since `TypeCx: Debug` --- compiler/rustc_pattern_analysis/src/usefulness.rs | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) (limited to 'compiler/rustc_pattern_analysis/src/usefulness.rs') diff --git a/compiler/rustc_pattern_analysis/src/usefulness.rs b/compiler/rustc_pattern_analysis/src/usefulness.rs index b15de1c0ca9..a8d0c2e67df 100644 --- a/compiler/rustc_pattern_analysis/src/usefulness.rs +++ b/compiler/rustc_pattern_analysis/src/usefulness.rs @@ -1198,6 +1198,7 @@ impl<'p, Cx: TypeCx> fmt::Debug for Matrix<'p, Cx> { /// The final `Pair(Some(_), true)` is then the resulting witness. /// /// See the top of the file for more detailed explanations and examples. +#[derive(Debug)] struct WitnessStack(Vec>); impl Clone for WitnessStack { @@ -1206,12 +1207,6 @@ impl Clone for WitnessStack { } } -impl fmt::Debug for WitnessStack { - fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result { - fmt.debug_tuple("WitnessStack").field(&self.0).finish() - } -} - impl WitnessStack { /// Asserts that the witness contains a single pattern, and returns it. fn single_pattern(self) -> WitnessPat { @@ -1256,6 +1251,7 @@ impl WitnessStack { /// /// Just as the `Matrix` starts with a single column, by the end of the algorithm, this has a single /// column, which contains the patterns that are missing for the match to be exhaustive. +#[derive(Debug)] struct WitnessMatrix(Vec>); impl Clone for WitnessMatrix { @@ -1264,12 +1260,6 @@ impl Clone for WitnessMatrix { } } -impl fmt::Debug for WitnessMatrix { - fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result { - fmt.debug_tuple("WitnessMatrix").field(&self.0).finish() - } -} - impl WitnessMatrix { /// New matrix with no witnesses. fn empty() -> Self { -- cgit 1.4.1-3-g733a5