diff options
| author | Nadrieril <nadrieril+git@gmail.com> | 2023-12-22 23:47:44 +0100 | 
|---|---|---|
| committer | Nadrieril <nadrieril+git@gmail.com> | 2023-12-23 00:08:38 +0100 | 
| commit | 5fccaee59c290b85612d4adb120b3e745d3f16dd (patch) | |
| tree | 70825ead158d7c22abeed9bde643e2f6fec65353 /compiler/rustc_pattern_analysis/src/lib.rs | |
| parent | f6af7478ba66fc016b5baabd689883b88316bfc2 (diff) | |
| download | rust-5fccaee59c290b85612d4adb120b3e745d3f16dd.tar.gz rust-5fccaee59c290b85612d4adb120b3e745d3f16dd.zip | |
Clarify the situation with dummy patterns and `PatData`
Use an explicit `Option` instead of requiring a `Default` bound
Diffstat (limited to 'compiler/rustc_pattern_analysis/src/lib.rs')
| -rw-r--r-- | compiler/rustc_pattern_analysis/src/lib.rs | 5 | 
1 files changed, 2 insertions, 3 deletions
| diff --git a/compiler/rustc_pattern_analysis/src/lib.rs b/compiler/rustc_pattern_analysis/src/lib.rs index 9f758dd8263..a1c9b157666 100644 --- a/compiler/rustc_pattern_analysis/src/lib.rs +++ b/compiler/rustc_pattern_analysis/src/lib.rs @@ -58,9 +58,8 @@ pub trait TypeCx: Sized + fmt::Debug { type StrLit: Clone + PartialEq + fmt::Debug; /// Extra data to store in a match arm. type ArmData: Copy + Clone + fmt::Debug; - /// Extra data to store in a pattern. `Default` needed when we create fictitious wildcard - /// patterns during analysis. - type PatData: Clone + Default; + /// Extra data to store in a pattern. + type PatData: Clone; /// FIXME(Nadrieril): `Cx` should only give us revealed types. fn reveal_opaque_ty(&self, ty: Self::Ty) -> Self::Ty; | 
