Rollup merge of #120331 - Nadrieril:no-arena, r=compiler-errors

pattern_analysis: use a plain `Vec` in `DeconstructedPat`

The use of an arena-allocated slice in `DeconstructedPat` dates to when we needed the arena anyway for lifetime reasons. Now that we don't, I'm thinking that if `thir::Pat` can use plain old `Vec`s, maybe so can I.

r? ```@ghost```
This commit is contained in:
Matthias Krüger
2024-02-06 22:45:40 +01:00
committed by GitHub
7 changed files with 61 additions and 64 deletions

View File

@@ -119,7 +119,7 @@ pub trait TypeCx: Sized + fmt::Debug {
/// `DeconstructedPat`. Only invoqued when `pat.ctor()` is `Struct | Variant(_) | UnionField`.
fn write_variant_name(
f: &mut fmt::Formatter<'_>,
pat: &crate::pat::DeconstructedPat<'_, Self>,
pat: &crate::pat::DeconstructedPat<Self>,
) -> fmt::Result;
/// Raise a bug.
@@ -130,9 +130,9 @@ pub trait TypeCx: Sized + fmt::Debug {
/// The default implementation does nothing.
fn lint_overlapping_range_endpoints(
&self,
_pat: &DeconstructedPat<'_, Self>,
_pat: &DeconstructedPat<Self>,
_overlaps_on: IntRange,
_overlaps_with: &[&DeconstructedPat<'_, Self>],
_overlaps_with: &[&DeconstructedPat<Self>],
) {
}
}
@@ -140,7 +140,7 @@ pub trait TypeCx: Sized + fmt::Debug {
/// The arm of a match expression.
#[derive(Debug)]
pub struct MatchArm<'p, Cx: TypeCx> {
pub pat: &'p DeconstructedPat<'p, Cx>,
pub pat: &'p DeconstructedPat<Cx>,
pub has_guard: bool,
pub arm_data: Cx::ArmData,
}