aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_ty/src/infer/pat.rs
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2021-06-17 17:22:32 +0100
committerGitHub <[email protected]>2021-06-17 17:22:32 +0100
commitce926aebc4461e38535047958c0b6f72b7a0c0ea (patch)
tree4b844e0681b459836bac22c34bee43e4dfa3dc5f /crates/hir_ty/src/infer/pat.rs
parent3ae0c5911ab50ee209179ee4329b0551abe6fc48 (diff)
parent02d25ab60d2701ce71fe2dfaca36627ad902e229 (diff)
Merge #9315
9315: Nest all the or-patterns! r=Veykril a=Veykril `cargo +nightly clippy --fix -Z unstable-options --allow-dirty -- -A clippy::all -D clippy::unnested_or_patterns` Co-authored-by: Lukas Wirth <[email protected]>
Diffstat (limited to 'crates/hir_ty/src/infer/pat.rs')
-rw-r--r--crates/hir_ty/src/infer/pat.rs9
1 files changed, 5 insertions, 4 deletions
diff --git a/crates/hir_ty/src/infer/pat.rs b/crates/hir_ty/src/infer/pat.rs
index 035f4ded6..58cb23e9d 100644
--- a/crates/hir_ty/src/infer/pat.rs
+++ b/crates/hir_ty/src/infer/pat.rs
@@ -297,10 +297,11 @@ fn is_non_ref_pat(body: &hir_def::body::Body, pat: PatId) -> bool {
297 Expr::Literal(Literal::String(..)) => false, 297 Expr::Literal(Literal::String(..)) => false,
298 _ => true, 298 _ => true,
299 }, 299 },
300 Pat::Bind { mode: BindingAnnotation::Mutable, subpat: Some(subpat), .. } 300 Pat::Bind {
301 | Pat::Bind { mode: BindingAnnotation::Unannotated, subpat: Some(subpat), .. } => { 301 mode: BindingAnnotation::Mutable | BindingAnnotation::Unannotated,
302 is_non_ref_pat(body, *subpat) 302 subpat: Some(subpat),
303 } 303 ..
304 } => is_non_ref_pat(body, *subpat),
304 Pat::Wild | Pat::Bind { .. } | Pat::Ref { .. } | Pat::Box { .. } | Pat::Missing => false, 305 Pat::Wild | Pat::Bind { .. } | Pat::Ref { .. } | Pat::Box { .. } | Pat::Missing => false,
305 } 306 }
306} 307}