diff options
| author | Zalathar <Zalathar@users.noreply.github.com> | 2024-08-03 20:45:12 +1000 |
|---|---|---|
| committer | Zalathar <Zalathar@users.noreply.github.com> | 2024-08-11 19:57:30 +1000 |
| commit | 92eb159d04f8fd6009899d978c504ee8522baccb (patch) | |
| tree | 095c6d98b4896b6074c2468abd4a0f44a4944d90 /compiler/rustc_pattern_analysis/src/rustc.rs | |
| parent | f53eb2724de4e1a7ec0985d035c208c55c37dd78 (diff) | |
| download | rust-92eb159d04f8fd6009899d978c504ee8522baccb.tar.gz rust-92eb159d04f8fd6009899d978c504ee8522baccb.zip | |
Remove `PatKind::Wild`
Diffstat (limited to 'compiler/rustc_pattern_analysis/src/rustc.rs')
| -rw-r--r-- | compiler/rustc_pattern_analysis/src/rustc.rs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/compiler/rustc_pattern_analysis/src/rustc.rs b/compiler/rustc_pattern_analysis/src/rustc.rs index 22b7ca18f84..6cf3680b3e8 100644 --- a/compiler/rustc_pattern_analysis/src/rustc.rs +++ b/compiler/rustc_pattern_analysis/src/rustc.rs @@ -780,7 +780,7 @@ impl<'p, 'tcx: 'p> RustcPatCtxt<'p, 'tcx> { use MaybeInfiniteInt::*; let cx = self; let kind = if matches!((range.lo, range.hi), (NegInfinity, PosInfinity)) { - PatKind::Wild + PatKind::Print("_".to_string()) } else if range.is_singleton() { let lo = cx.hoist_pat_range_bdy(range.lo, ty); let value = lo.as_finite().unwrap(); @@ -890,7 +890,9 @@ impl<'p, 'tcx: 'p> RustcPatCtxt<'p, 'tcx> { } &Str(value) => PatKind::Constant { value }, Never if self.tcx.features().never_patterns => PatKind::Never, - Never | Wildcard | NonExhaustive | Hidden | PrivateUninhabited => PatKind::Wild, + Never | Wildcard | NonExhaustive | Hidden | PrivateUninhabited => { + PatKind::Print("_".to_string()) + } Missing { .. } => bug!( "trying to convert a `Missing` constructor into a `Pat`; this is probably a bug, `Missing` should have been processed in `apply_constructors`" |
