diff options
| author | Nadrieril <nadrieril+git@gmail.com> | 2023-12-15 16:18:21 +0100 |
|---|---|---|
| committer | Nadrieril <nadrieril+git@gmail.com> | 2023-12-15 16:58:38 +0100 |
| commit | 1e89a38423ee1b562e3b10278d0097d88bc48f5f (patch) | |
| tree | 4f9a1a59238d7c5b80020844b430bab6b6eb4de8 /compiler/rustc_pattern_analysis/src/lib.rs | |
| parent | 8c5e89907c1f6312c8613b5d6851381bbcde8052 (diff) | |
| download | rust-1e89a38423ee1b562e3b10278d0097d88bc48f5f.tar.gz rust-1e89a38423ee1b562e3b10278d0097d88bc48f5f.zip | |
`pattern_analysis` doesn't need to know what spans are
Diffstat (limited to 'compiler/rustc_pattern_analysis/src/lib.rs')
| -rw-r--r-- | compiler/rustc_pattern_analysis/src/lib.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/compiler/rustc_pattern_analysis/src/lib.rs b/compiler/rustc_pattern_analysis/src/lib.rs index 36ec86eb5b3..12d2e0fc18b 100644 --- a/compiler/rustc_pattern_analysis/src/lib.rs +++ b/compiler/rustc_pattern_analysis/src/lib.rs @@ -37,14 +37,17 @@ use crate::rustc::RustcMatchCheckCtxt; use crate::usefulness::{compute_match_usefulness, ValidityConstraint}; pub trait MatchCx: Sized + Clone + fmt::Debug { + /// The type of a pattern. 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; + /// Extra data to store on a pattern. `Default` needed when we create fictitious wildcard + /// patterns during analysis. + type PatData: Clone + Default; fn is_opaque_ty(ty: Self::Ty) -> bool; fn is_exhaustive_patterns_feature_on(&self) -> bool; |
