diff options
| author | Nadrieril <nadrieril+git@gmail.com> | 2023-12-11 20:45:34 +0100 |
|---|---|---|
| committer | Nadrieril <nadrieril+git@gmail.com> | 2023-12-15 16:58:37 +0100 |
| commit | 42f43938248d1272c0b3edc85385bde322a9c7fc (patch) | |
| tree | b16d0e497638f4a60a5fb56751bf658f18e38a4a /compiler/rustc_pattern_analysis/src/lib.rs | |
| parent | cb622f3994a23d09bb24ef1add67a1569009d558 (diff) | |
| download | rust-42f43938248d1272c0b3edc85385bde322a9c7fc.tar.gz rust-42f43938248d1272c0b3edc85385bde322a9c7fc.zip | |
Iron out last rustc-specific details
Diffstat (limited to 'compiler/rustc_pattern_analysis/src/lib.rs')
| -rw-r--r-- | compiler/rustc_pattern_analysis/src/lib.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/compiler/rustc_pattern_analysis/src/lib.rs b/compiler/rustc_pattern_analysis/src/lib.rs index 192f35c6abf..d0eff55f5a1 100644 --- a/compiler/rustc_pattern_analysis/src/lib.rs +++ b/compiler/rustc_pattern_analysis/src/lib.rs @@ -30,8 +30,12 @@ use crate::rustc::RustcCtxt; pub trait MatchCx: Sized + Clone + fmt::Debug { type Ty: Copy + Clone + fmt::Debug; // FIXME: remove Copy type Span: Clone + Default; + /// The index of an enum variant. type VariantIdx: Clone + Idx; + /// A string literal type StrLit: Clone + PartialEq + fmt::Debug; + /// Extra data to store on a match arm. + type ArmData: Copy + Clone + fmt::Debug; fn is_opaque_ty(ty: Self::Ty) -> bool; fn is_exhaustive_patterns_feature_on(&self) -> bool; @@ -60,8 +64,8 @@ pub trait MatchCx: Sized + Clone + fmt::Debug { pub struct MatchArm<'p, Cx: MatchCx> { /// The pattern must have been lowered through `check_match::MatchVisitor::lower_pattern`. pub pat: &'p DeconstructedPat<'p, Cx>, - pub hir_id: HirId, pub has_guard: bool, + pub arm_data: Cx::ArmData, } impl<'p, Cx: MatchCx> Copy for MatchArm<'p, Cx> {} |
