Skip to content

Commit c60f6b3

Browse files
committed
Eliminate PatKind::Path
1 parent d8d91b6 commit c60f6b3

File tree

37 files changed

+196
-150
lines changed

37 files changed

+196
-150
lines changed

compiler/rustc_ast_lowering/src/expr.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -1391,7 +1391,11 @@ impl<'hir> LoweringContext<'_, 'hir> {
13911391
None,
13921392
);
13931393
// Destructure like a unit struct.
1394-
let unit_struct_pat = hir::PatKind::Path(qpath);
1394+
let unit_struct_pat = hir::PatKind::Expr(self.arena.alloc(hir::PatExpr {
1395+
hir_id: self.lower_node_id(lhs.id),
1396+
span: lhs.span,
1397+
kind: hir::PatExprKind::Path(qpath),
1398+
}));
13951399
return self.pat_without_dbm(lhs.span, unit_struct_pat);
13961400
}
13971401
}

compiler/rustc_ast_lowering/src/pat.rs

+14-3
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,15 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
6969
ImplTraitContext::Disallowed(ImplTraitPosition::Path),
7070
None,
7171
);
72-
break hir::PatKind::Path(qpath);
72+
let kind = hir::PatExprKind::Path(qpath);
73+
let expr = hir::PatExpr { hir_id: pat_hir_id, span: pattern.span, kind };
74+
let expr = self.arena.alloc(expr);
75+
return hir::Pat {
76+
hir_id: self.next_id(),
77+
kind: hir::PatKind::Expr(expr),
78+
span: pattern.span,
79+
default_binding_modes: true,
80+
};
7381
}
7482
PatKind::Struct(qself, path, fields, etc) => {
7583
let qpath = self.lower_qpath(
@@ -305,14 +313,17 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
305313
Some(res) => {
306314
let hir_id = self.next_id();
307315
let res = self.lower_res(res);
308-
hir::PatKind::Path(hir::QPath::Resolved(
316+
let kind = hir::PatExprKind::Path(hir::QPath::Resolved(
309317
None,
310318
self.arena.alloc(hir::Path {
311319
span: self.lower_span(ident.span),
312320
res,
313321
segments: arena_vec![self; hir::PathSegment::new(self.lower_ident(ident), hir_id, res)],
314322
}),
315-
))
323+
));
324+
let lit = hir::PatExpr { kind, hir_id: self.next_id(), span: ident.span };
325+
let lit = self.arena.alloc(lit);
326+
hir::PatKind::Expr(lit)
316327
}
317328
}
318329
}

compiler/rustc_hir/src/hir.rs

+2-5
Original file line numberDiff line numberDiff line change
@@ -1386,7 +1386,7 @@ impl<'hir> Pat<'hir> {
13861386

13871387
use PatKind::*;
13881388
match self.kind {
1389-
Wild | Never | Expr(_) | Range(..) | Binding(.., None) | Path(_) | Err(_) => true,
1389+
Wild | Never | Expr(_) | Range(..) | Binding(.., None) | Err(_) => true,
13901390
Box(s) | Deref(s) | Ref(s, _) | Binding(.., Some(s)) => s.walk_short_(it),
13911391
Struct(_, fields, _) => fields.iter().all(|field| field.pat.walk_short_(it)),
13921392
TupleStruct(_, s, _) | Tuple(s, _) | Or(s) => s.iter().all(|p| p.walk_short_(it)),
@@ -1413,7 +1413,7 @@ impl<'hir> Pat<'hir> {
14131413

14141414
use PatKind::*;
14151415
match self.kind {
1416-
Wild | Never | Expr(_) | Range(..) | Binding(.., None) | Path(_) | Err(_) => {}
1416+
Wild | Never | Expr(_) | Range(..) | Binding(.., None) | Err(_) => {}
14171417
Box(s) | Deref(s) | Ref(s, _) | Binding(.., Some(s)) => s.walk_(it),
14181418
Struct(_, fields, _) => fields.iter().for_each(|field| field.pat.walk_(it)),
14191419
TupleStruct(_, s, _) | Tuple(s, _) | Or(s) => s.iter().for_each(|p| p.walk_(it)),
@@ -1566,9 +1566,6 @@ pub enum PatKind<'hir> {
15661566
/// A never pattern `!`.
15671567
Never,
15681568

1569-
/// A path pattern for a unit struct/variant or a (maybe-associated) constant.
1570-
Path(QPath<'hir>),
1571-
15721569
/// A tuple pattern (e.g., `(a, b)`).
15731570
/// If the `..` pattern fragment is present, then `Option<usize>` denotes its position.
15741571
/// `0 <= position <= subpats.len()`

compiler/rustc_hir/src/intravisit.rs

-3
Original file line numberDiff line numberDiff line change
@@ -668,9 +668,6 @@ pub fn walk_pat<'v, V: Visitor<'v>>(visitor: &mut V, pattern: &'v Pat<'v>) -> V:
668668
try_visit!(visitor.visit_qpath(qpath, pattern.hir_id, pattern.span));
669669
walk_list!(visitor, visit_pat, children);
670670
}
671-
PatKind::Path(ref qpath) => {
672-
try_visit!(visitor.visit_qpath(qpath, pattern.hir_id, pattern.span));
673-
}
674671
PatKind::Struct(ref qpath, fields, _) => {
675672
try_visit!(visitor.visit_qpath(qpath, pattern.hir_id, pattern.span));
676673
walk_list!(visitor, visit_pat_field, fields);

compiler/rustc_hir/src/pat_util.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,10 @@ impl hir::Pat<'_> {
105105
let mut variants = vec![];
106106
self.walk(|p| match &p.kind {
107107
PatKind::Or(_) => false,
108-
PatKind::Path(hir::QPath::Resolved(_, path))
108+
PatKind::Expr(hir::PatExpr {
109+
kind: hir::PatExprKind::Path(hir::QPath::Resolved(_, path)),
110+
..
111+
})
109112
| PatKind::TupleStruct(hir::QPath::Resolved(_, path), ..)
110113
| PatKind::Struct(hir::QPath::Resolved(_, path), ..) => {
111114
if let Res::Def(DefKind::Variant | DefKind::Ctor(CtorOf::Variant, ..), id) =

compiler/rustc_hir_analysis/src/check/region.rs

-1
Original file line numberDiff line numberDiff line change
@@ -700,7 +700,6 @@ fn resolve_local<'tcx>(
700700
| PatKind::Binding(hir::BindingMode(hir::ByRef::No, _), ..)
701701
| PatKind::Wild
702702
| PatKind::Never
703-
| PatKind::Path(_)
704703
| PatKind::Expr(_)
705704
| PatKind::Range(_, _, _)
706705
| PatKind::Err(_) => false,

compiler/rustc_hir_analysis/src/hir_ty_lowering/lint.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
3636
kind: hir::ExprKind::Path(hir::QPath::TypeRelative(qself, _)),
3737
..
3838
})
39-
| hir::Node::Pat(hir::Pat {
40-
kind: hir::PatKind::Path(hir::QPath::TypeRelative(qself, _)),
39+
| hir::Node::PatExpr(hir::PatExpr {
40+
kind: hir::PatExprKind::Path(hir::QPath::TypeRelative(qself, _)),
4141
..
4242
}) if qself.hir_id == self_ty.hir_id => true,
4343
_ => false,

compiler/rustc_hir_pretty/src/lib.rs

-3
Original file line numberDiff line numberDiff line change
@@ -1905,9 +1905,6 @@ impl<'a> State<'a> {
19051905
}
19061906
self.pclose();
19071907
}
1908-
PatKind::Path(ref qpath) => {
1909-
self.print_qpath(qpath, true);
1910-
}
19111908
PatKind::Struct(ref qpath, fields, etc) => {
19121909
self.print_qpath(qpath, true);
19131910
self.nbsp();

compiler/rustc_hir_typeck/src/expr.rs

-1
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,6 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
477477
hir::PatKind::Binding(_, _, _, _)
478478
| hir::PatKind::Struct(_, _, _)
479479
| hir::PatKind::TupleStruct(_, _, _)
480-
| hir::PatKind::Path(_)
481480
| hir::PatKind::Tuple(_, _)
482481
| hir::PatKind::Box(_)
483482
| hir::PatKind::Ref(_, _)

compiler/rustc_hir_typeck/src/expr_use_visitor.rs

+4-6
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,9 @@ use hir::def::DefKind;
1111
use hir::pat_util::EnumerateAndAdjustIterator as _;
1212
use rustc_abi::{FIRST_VARIANT, FieldIdx, VariantIdx};
1313
use rustc_data_structures::fx::FxIndexMap;
14-
use rustc_hir as hir;
1514
use rustc_hir::def::{CtorOf, Res};
1615
use rustc_hir::def_id::LocalDefId;
17-
use rustc_hir::{HirId, PatKind};
16+
use rustc_hir::{self as hir, HirId, PatExpr, PatExprKind, PatKind};
1817
use rustc_lint::LateContext;
1918
use rustc_middle::hir::place::ProjectionKind;
2019
// Export these here so that Clippy can use them.
@@ -564,11 +563,11 @@ impl<'tcx, Cx: TypeInformationCtxt<'tcx>, D: Delegate<'tcx>> ExprUseVisitor<'tcx
564563
// FIXME(never_patterns): does this do what I expect?
565564
needs_to_be_read = true;
566565
}
567-
PatKind::Path(qpath) => {
566+
PatKind::Expr(PatExpr { kind: PatExprKind::Path(qpath), hir_id, .. }) => {
568567
// A `Path` pattern is just a name like `Foo`. This is either a
569568
// named constant or else it refers to an ADT variant
570569

571-
let res = self.cx.typeck_results().qpath_res(qpath, pat.hir_id);
570+
let res = self.cx.typeck_results().qpath_res(qpath, *hir_id);
572571
match res {
573572
Res::Def(DefKind::Const, _) | Res::Def(DefKind::AssocConst, _) => {
574573
// Named constants have to be equated with the value
@@ -1800,8 +1799,7 @@ impl<'tcx, Cx: TypeInformationCtxt<'tcx>, D: Delegate<'tcx>> ExprUseVisitor<'tcx
18001799
}
18011800
}
18021801

1803-
PatKind::Path(_)
1804-
| PatKind::Binding(.., None)
1802+
PatKind::Binding(.., None)
18051803
| PatKind::Expr(..)
18061804
| PatKind::Range(..)
18071805
| PatKind::Never

compiler/rustc_hir_typeck/src/fn_ctxt/suggestions.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ use hir::def_id::LocalDefId;
55
use rustc_ast::util::parser::ExprPrecedence;
66
use rustc_data_structures::packed::Pu128;
77
use rustc_errors::{Applicability, Diag, MultiSpan};
8-
use rustc_hir as hir;
98
use rustc_hir::def::{CtorKind, CtorOf, DefKind, Res};
109
use rustc_hir::lang_items::LangItem;
1110
use rustc_hir::{
12-
Arm, CoroutineDesugaring, CoroutineKind, CoroutineSource, Expr, ExprKind, GenericBound, HirId,
13-
Node, Path, QPath, Stmt, StmtKind, TyKind, WherePredicateKind, expr_needs_parens,
11+
self as hir, Arm, CoroutineDesugaring, CoroutineKind, CoroutineSource, Expr, ExprKind,
12+
GenericBound, HirId, Node, PatExpr, PatExprKind, Path, QPath, Stmt, StmtKind, TyKind,
13+
WherePredicateKind, expr_needs_parens,
1414
};
1515
use rustc_hir_analysis::collect::suggest_impl_trait;
1616
use rustc_hir_analysis::hir_ty_lowering::HirTyLowerer;
@@ -1426,8 +1426,8 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
14261426
// since the user probably just misunderstood how `let else`
14271427
// and `&&` work together.
14281428
if let Some((_, hir::Node::LetStmt(local))) = cond_parent
1429-
&& let hir::PatKind::Path(qpath) | hir::PatKind::TupleStruct(qpath, _, _) =
1430-
&local.pat.kind
1429+
&& let hir::PatKind::Expr(PatExpr { kind: PatExprKind::Path(qpath), .. })
1430+
| hir::PatKind::TupleStruct(qpath, _, _) = &local.pat.kind
14311431
&& let hir::QPath::Resolved(None, path) = qpath
14321432
&& let Some(did) = path
14331433
.res

compiler/rustc_hir_typeck/src/method/suggest.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
177177
})
178178
| hir::Node::Pat(&hir::Pat {
179179
kind:
180-
hir::PatKind::Path(QPath::TypeRelative(rcvr, segment))
181-
| hir::PatKind::Struct(QPath::TypeRelative(rcvr, segment), ..)
180+
hir::PatKind::Struct(QPath::TypeRelative(rcvr, segment), ..)
182181
| hir::PatKind::TupleStruct(QPath::TypeRelative(rcvr, segment), ..),
183182
span,
184183
..

compiler/rustc_hir_typeck/src/pat.rs

+32-22
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ use rustc_errors::{
1111
use rustc_hir::def::{CtorKind, DefKind, Res};
1212
use rustc_hir::pat_util::EnumerateAndAdjustIterator;
1313
use rustc_hir::{
14-
self as hir, BindingMode, ByRef, ExprKind, HirId, LangItem, Mutability, Pat, PatKind,
15-
expr_needs_parens,
14+
self as hir, BindingMode, ByRef, ExprKind, HirId, LangItem, Mutability, Pat, PatExpr,
15+
PatExprKind, PatKind, expr_needs_parens,
1616
};
1717
use rustc_infer::infer;
1818
use rustc_middle::traits::PatternOriginExpr;
@@ -250,9 +250,9 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
250250
fn check_pat(&self, pat: &'tcx Pat<'tcx>, expected: Ty<'tcx>, pat_info: PatInfo<'_, 'tcx>) {
251251
let PatInfo { binding_mode, max_ref_mutbl, top_info: ti, current_depth, .. } = pat_info;
252252

253-
let path_res = match &pat.kind {
254-
PatKind::Path(qpath) => {
255-
Some(self.resolve_ty_and_res_fully_qualified_call(qpath, pat.hir_id, pat.span))
253+
let path_res = match pat.kind {
254+
PatKind::Expr(&PatExpr { kind: PatExprKind::Path(ref qpath), hir_id, span }) => {
255+
Some(self.resolve_ty_and_res_fully_qualified_call(qpath, hir_id, span))
256256
}
257257
_ => None,
258258
};
@@ -271,6 +271,19 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
271271
PatKind::Wild | PatKind::Err(_) => expected,
272272
// We allow any type here; we ensure that the type is uninhabited during match checking.
273273
PatKind::Never => expected,
274+
PatKind::Expr(&PatExpr { kind: PatExprKind::Path(ref qpath), hir_id, span }) => {
275+
let ty = self.check_pat_path(
276+
hir_id,
277+
pat.hir_id,
278+
span,
279+
qpath,
280+
path_res.unwrap(),
281+
expected,
282+
ti,
283+
);
284+
self.write_ty(hir_id, ty);
285+
ty
286+
}
274287
PatKind::Expr(lt) => self.check_pat_lit(pat.span, lt, expected, ti),
275288
PatKind::Range(lhs, rhs, _) => self.check_pat_range(pat.span, lhs, rhs, expected, ti),
276289
PatKind::Binding(ba, var_id, ident, sub) => {
@@ -279,9 +292,6 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
279292
PatKind::TupleStruct(ref qpath, subpats, ddpos) => {
280293
self.check_pat_tuple_struct(pat, qpath, subpats, ddpos, expected, pat_info)
281294
}
282-
PatKind::Path(ref qpath) => {
283-
self.check_pat_path(pat.hir_id, pat.span, qpath, path_res.unwrap(), expected, ti)
284-
}
285295
PatKind::Struct(ref qpath, fields, has_rest_pat) => {
286296
self.check_pat_struct(pat, qpath, fields, has_rest_pat, expected, pat_info)
287297
}
@@ -389,16 +399,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
389399
| PatKind::Slice(..) => AdjustMode::Peel,
390400
// A never pattern behaves somewhat like a literal or unit variant.
391401
PatKind::Never => AdjustMode::Peel,
392-
// String and byte-string literals result in types `&str` and `&[u8]` respectively.
393-
// All other literals result in non-reference types.
394-
// As a result, we allow `if let 0 = &&0 {}` but not `if let "foo" = &&"foo" {}`.
395-
//
396-
// Call `resolve_vars_if_possible` here for inline const blocks.
397-
PatKind::Expr(lt) => match self.resolve_vars_if_possible(self.check_pat_expr_unadjusted(lt)).kind() {
398-
ty::Ref(..) => AdjustMode::Pass,
399-
_ => AdjustMode::Peel,
400-
},
401-
PatKind::Path(_) => match opt_path_res.unwrap() {
402+
PatKind::Expr(PatExpr { kind: PatExprKind::Path(_), .. }) => match opt_path_res.unwrap() {
402403
// These constants can be of a reference type, e.g. `const X: &u8 = &0;`.
403404
// Peeling the reference types too early will cause type checking failures.
404405
// Although it would be possible to *also* peel the types of the constants too.
@@ -409,6 +410,15 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
409410
// a reference type wherefore peeling doesn't give up any expressiveness.
410411
_ => AdjustMode::Peel,
411412
},
413+
// String and byte-string literals result in types `&str` and `&[u8]` respectively.
414+
// All other literals result in non-reference types.
415+
// As a result, we allow `if let 0 = &&0 {}` but not `if let "foo" = &&"foo" {}`.
416+
//
417+
// Call `resolve_vars_if_possible` here for inline const blocks.
418+
PatKind::Expr(lt) => match self.resolve_vars_if_possible(self.check_pat_expr_unadjusted(lt)).kind() {
419+
ty::Ref(..) => AdjustMode::Pass,
420+
_ => AdjustMode::Peel,
421+
},
412422
// Ref patterns are complicated, we handle them in `check_pat_ref`.
413423
PatKind::Ref(..) => AdjustMode::Pass,
414424
// A `_` pattern works with any expected type, so there's no need to do anything.
@@ -931,7 +941,6 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
931941
PatKind::Wild
932942
| PatKind::Never
933943
| PatKind::Binding(..)
934-
| PatKind::Path(..)
935944
| PatKind::Box(..)
936945
| PatKind::Deref(_)
937946
| PatKind::Ref(..)
@@ -1070,6 +1079,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
10701079
fn check_pat_path(
10711080
&self,
10721081
hir_id: HirId,
1082+
pat_id: HirId,
10731083
span: Span,
10741084
qpath: &hir::QPath<'_>,
10751085
path_resolution: (Res, Option<LoweredTy<'tcx>>, &'tcx [hir::PathSegment<'tcx>]),
@@ -1127,7 +1137,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
11271137
if let Err(err) =
11281138
self.demand_suptype_with_origin(&self.pattern_cause(ti, span), expected, pat_ty)
11291139
{
1130-
self.emit_bad_pat_path(err, hir_id, span, res, pat_res, pat_ty, segments);
1140+
self.emit_bad_pat_path(err, pat_id, span, res, pat_res, pat_ty, segments);
11311141
}
11321142
pat_ty
11331143
}
@@ -1170,7 +1180,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
11701180
fn emit_bad_pat_path(
11711181
&self,
11721182
mut e: Diag<'_>,
1173-
hir_id: HirId,
1183+
pat_id: HirId,
11741184
pat_span: Span,
11751185
res: Res,
11761186
pat_res: Res,
@@ -1189,7 +1199,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
11891199
res.descr(),
11901200
),
11911201
);
1192-
match self.tcx.parent_hir_node(hir_id) {
1202+
match self.tcx.parent_hir_node(pat_id) {
11931203
hir::Node::PatField(..) => {
11941204
e.span_suggestion_verbose(
11951205
ident.span.shrink_to_hi(),

compiler/rustc_lint/src/internal.rs

+4-6
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use rustc_hir::def::Res;
66
use rustc_hir::def_id::DefId;
77
use rustc_hir::{
88
BinOp, BinOpKind, Expr, ExprKind, GenericArg, HirId, Impl, Item, ItemKind, Node, Pat, PatKind,
9-
Path, PathSegment, QPath, Ty, TyKind,
9+
PatExpr, PatExprKind, Path, PathSegment, QPath, Ty, TyKind,
1010
};
1111
use rustc_middle::ty::{self, GenericArgsRef, Ty as MiddleTy};
1212
use rustc_session::{declare_lint_pass, declare_tool_lint};
@@ -164,11 +164,9 @@ impl<'tcx> LateLintPass<'tcx> for TyTyKind {
164164
TyKind::Path(QPath::Resolved(_, path)) => {
165165
if lint_ty_kind_usage(cx, &path.res) {
166166
let span = match cx.tcx.parent_hir_node(ty.hir_id) {
167-
Node::Pat(Pat {
168-
kind:
169-
PatKind::Path(qpath)
170-
| PatKind::TupleStruct(qpath, ..)
171-
| PatKind::Struct(qpath, ..),
167+
Node::PatExpr(PatExpr { kind: PatExprKind::Path(qpath), .. })
168+
| Node::Pat(Pat {
169+
kind: PatKind::TupleStruct(qpath, ..) | PatKind::Struct(qpath, ..),
172170
..
173171
})
174172
| Node::Expr(

compiler/rustc_lint/src/nonstandard_style.rs

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use rustc_abi::ExternAbi;
22
use rustc_hir::def::{DefKind, Res};
33
use rustc_hir::intravisit::FnKind;
4-
use rustc_hir::{AttrArgs, AttrItem, AttrKind, GenericParamKind, PatKind};
4+
use rustc_hir::{AttrArgs, AttrItem, AttrKind, GenericParamKind, PatExpr, PatExprKind, PatKind};
55
use rustc_middle::ty;
66
use rustc_session::config::CrateType;
77
use rustc_session::{declare_lint, declare_lint_pass};
@@ -527,7 +527,11 @@ impl<'tcx> LateLintPass<'tcx> for NonUpperCaseGlobals {
527527

528528
fn check_pat(&mut self, cx: &LateContext<'_>, p: &hir::Pat<'_>) {
529529
// Lint for constants that look like binding identifiers (#7526)
530-
if let PatKind::Path(hir::QPath::Resolved(None, path)) = p.kind {
530+
if let PatKind::Expr(PatExpr {
531+
kind: PatExprKind::Path(hir::QPath::Resolved(None, path)),
532+
..
533+
}) = p.kind
534+
{
531535
if let Res::Def(DefKind::Const, _) = path.res {
532536
if let [segment] = path.segments {
533537
NonUpperCaseGlobals::check_upper_case(

compiler/rustc_mir_build/src/thir/pattern/mod.rs

-4
Original file line numberDiff line numberDiff line change
@@ -332,10 +332,6 @@ impl<'a, 'tcx> PatCtxt<'a, 'tcx> {
332332
.unwrap_or_else(PatKind::Error)
333333
}
334334

335-
hir::PatKind::Path(ref qpath) => {
336-
return self.lower_path(qpath, pat.hir_id, pat.span);
337-
}
338-
339335
hir::PatKind::Deref(subpattern) => {
340336
let mutable = self.typeck_results.pat_has_ref_mut_binding(subpattern);
341337
let mutability = if mutable { hir::Mutability::Mut } else { hir::Mutability::Not };

0 commit comments

Comments
 (0)