diff options
| author | Nadrieril <nadrieril+git@gmail.com> | 2023-12-22 23:25:12 +0100 |
|---|---|---|
| committer | Nadrieril <nadrieril+git@gmail.com> | 2023-12-26 23:14:23 +0100 |
| commit | fc0be3c921abc95e50e9fcb50598f2b6ee6fb4d4 (patch) | |
| tree | 8b443ea7d5ec73900fcdda26e509cfbf3f4014a7 /compiler/rustc_pattern_analysis/src/rustc.rs | |
| parent | deace71034d4940d064619882e0297c4ad858b2e (diff) | |
| download | rust-fc0be3c921abc95e50e9fcb50598f2b6ee6fb4d4.tar.gz rust-fc0be3c921abc95e50e9fcb50598f2b6ee6fb4d4.zip | |
Keep reference to the original `Pat` in `DeconstructedPat`
Diffstat (limited to 'compiler/rustc_pattern_analysis/src/rustc.rs')
| -rw-r--r-- | compiler/rustc_pattern_analysis/src/rustc.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/compiler/rustc_pattern_analysis/src/rustc.rs b/compiler/rustc_pattern_analysis/src/rustc.rs index e9922f621b7..3c1bdfd910e 100644 --- a/compiler/rustc_pattern_analysis/src/rustc.rs +++ b/compiler/rustc_pattern_analysis/src/rustc.rs @@ -540,7 +540,7 @@ impl<'p, 'tcx> RustcMatchCheckCtxt<'p, 'tcx> { // `Ref`), and has one field. That field has constructor `Str(value)` and no // subfields. // Note: `t` is `str`, not `&str`. - let subpattern = DeconstructedPat::new(Str(*value), &[], *t, pat.span); + let subpattern = DeconstructedPat::new(Str(*value), &[], *t, pat); ctor = Ref; fields = singleton(subpattern) } @@ -624,7 +624,7 @@ impl<'p, 'tcx> RustcMatchCheckCtxt<'p, 'tcx> { fields = &[]; } } - DeconstructedPat::new(ctor, fields, pat.ty, pat.span) + DeconstructedPat::new(ctor, fields, pat.ty, pat) } /// Convert back to a `thir::PatRangeBoundary` for diagnostic purposes. @@ -894,7 +894,7 @@ impl<'p, 'tcx> TypeCx for RustcMatchCheckCtxt<'p, 'tcx> { type VariantIdx = VariantIdx; type StrLit = Const<'tcx>; type ArmData = HirId; - type PatData = Span; + type PatData = &'p Pat<'tcx>; fn is_exhaustive_patterns_feature_on(&self) -> bool { self.tcx.features().exhaustive_patterns |
