diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2024-02-03 22:25:14 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-02-03 22:25:14 +0100 |
| commit | f3ebf1e50fa266a1ace583826fa2b906f0965ff1 (patch) | |
| tree | 88a9f411ef79d3c30eff677dd96eaa94ee5b8652 /compiler/rustc_pattern_analysis/src/usefulness.rs | |
| parent | 6f24836a5bc2a9e894b864666b1ea9b30ffbbc99 (diff) | |
| parent | 40402cbadad4f7df9ab7e2f3089a5b038d19f586 (diff) | |
| download | rust-f3ebf1e50fa266a1ace583826fa2b906f0965ff1.tar.gz rust-f3ebf1e50fa266a1ace583826fa2b906f0965ff1.zip | |
Rollup merge of #120516 - Nadrieril:cleanup-impls, r=compiler-errors
pattern_analysis: cleanup manual impls https://github.com/rust-lang/rust/pull/120420 introduced some unneeded manual impls. I remove them here. r? ```@Nilstrieb```
Diffstat (limited to 'compiler/rustc_pattern_analysis/src/usefulness.rs')
| -rw-r--r-- | compiler/rustc_pattern_analysis/src/usefulness.rs | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/compiler/rustc_pattern_analysis/src/usefulness.rs b/compiler/rustc_pattern_analysis/src/usefulness.rs index 3d45d032a99..f729f0aa41b 100644 --- a/compiler/rustc_pattern_analysis/src/usefulness.rs +++ b/compiler/rustc_pattern_analysis/src/usefulness.rs @@ -1207,6 +1207,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<Cx: TypeCx>(Vec<WitnessPat<Cx>>); impl<Cx: TypeCx> Clone for WitnessStack<Cx> { @@ -1215,12 +1216,6 @@ impl<Cx: TypeCx> Clone for WitnessStack<Cx> { } } -impl<Cx: TypeCx> fmt::Debug for WitnessStack<Cx> { - fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result { - fmt.debug_tuple("WitnessStack").field(&self.0).finish() - } -} - impl<Cx: TypeCx> WitnessStack<Cx> { /// Asserts that the witness contains a single pattern, and returns it. fn single_pattern(self) -> WitnessPat<Cx> { @@ -1265,6 +1260,7 @@ impl<Cx: TypeCx> WitnessStack<Cx> { /// /// 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<Cx: TypeCx>(Vec<WitnessStack<Cx>>); impl<Cx: TypeCx> Clone for WitnessMatrix<Cx> { @@ -1273,12 +1269,6 @@ impl<Cx: TypeCx> Clone for WitnessMatrix<Cx> { } } -impl<Cx: TypeCx> fmt::Debug for WitnessMatrix<Cx> { - fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result { - fmt.debug_tuple("WitnessMatrix").field(&self.0).finish() - } -} - impl<Cx: TypeCx> WitnessMatrix<Cx> { /// New matrix with no witnesses. fn empty() -> Self { |
