diff options
| author | Michael Goulet <michael@errs.io> | 2024-03-20 16:53:50 -0400 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2024-03-21 11:42:49 -0400 |
| commit | 2d633317f30dd02895f167b65dc1feeee0d08265 (patch) | |
| tree | 50b3622db66615853ae53baa9c54d968f01e413b /compiler/rustc_hir_analysis | |
| parent | 2627e9f3012a97d3136b3e11bf6bd0853c38a534 (diff) | |
| download | rust-2d633317f30dd02895f167b65dc1feeee0d08265.tar.gz rust-2d633317f30dd02895f167b65dc1feeee0d08265.zip | |
Implement macro-based deref!() syntax for deref patterns
Stop using `box PAT` syntax for deref patterns, as it's misleading and also causes their semantics being tangled up.
Diffstat (limited to 'compiler/rustc_hir_analysis')
| -rw-r--r-- | compiler/rustc_hir_analysis/src/check/region.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_hir_analysis/src/check/region.rs b/compiler/rustc_hir_analysis/src/check/region.rs index 3c26729eff8..eb31e1546cf 100644 --- a/compiler/rustc_hir_analysis/src/check/region.rs +++ b/compiler/rustc_hir_analysis/src/check/region.rs @@ -668,7 +668,7 @@ fn resolve_local<'tcx>( | PatKind::TupleStruct(_, subpats, _) | PatKind::Tuple(subpats, _) => subpats.iter().any(|p| is_binding_pat(p)), - PatKind::Box(subpat) => is_binding_pat(subpat), + PatKind::Box(subpat) | PatKind::Deref(subpat) => is_binding_pat(subpat), PatKind::Ref(_, _) | PatKind::Binding(hir::BindingAnnotation(hir::ByRef::No, _), ..) |
