summary refs log tree commit diff
path: root/compiler/rustc_pattern_analysis/src/lib.rs
diff options
context:
space:
mode:
authorNadrieril <nadrieril+git@gmail.com>2023-12-22 23:47:44 +0100
committerNadrieril <nadrieril+git@gmail.com>2023-12-23 00:08:38 +0100
commit5fccaee59c290b85612d4adb120b3e745d3f16dd (patch)
tree70825ead158d7c22abeed9bde643e2f6fec65353 /compiler/rustc_pattern_analysis/src/lib.rs
parentf6af7478ba66fc016b5baabd689883b88316bfc2 (diff)
downloadrust-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.rs5
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;