Use a Vec instead of a slice in DeconstructedPat

This commit is contained in:
Nadrieril 2024-01-25 03:37:24 +01:00
parent 11f32b73e0
commit be77cf86ba
5 changed files with 51 additions and 54 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,
}