Skip to content

Commit 6a6e2ae

Browse files
committed
Eliminate PatKind::Path
1 parent 9d7525b commit 6a6e2ae

File tree

37 files changed

+114
-110
lines changed

37 files changed

+114
-110
lines changed

compiler/rustc_ast_lowering/src/expr.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1391,7 +1391,7 @@ 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(hir::PatExprKind::Path(qpath));
13951395
return self.pat_without_dbm(lhs.span, unit_struct_pat);
13961396
}
13971397
}

compiler/rustc_ast_lowering/src/pat.rs

+9-3
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,13 @@ 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+
return hir::Pat {
74+
hir_id: pat_hir_id,
75+
kind: hir::PatKind::Expr(kind),
76+
span: pattern.span,
77+
default_binding_modes: true,
78+
};
7379
}
7480
PatKind::Struct(qself, path, fields, etc) => {
7581
let qpath = self.lower_qpath(
@@ -313,14 +319,14 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
313319
Some(res) => {
314320
let hir_id = self.next_id();
315321
let res = self.lower_res(res);
316-
hir::PatKind::Path(hir::QPath::Resolved(
322+
hir::PatKind::Expr(hir::PatExprKind::Path(hir::QPath::Resolved(
317323
None,
318324
self.arena.alloc(hir::Path {
319325
span: self.lower_span(ident.span),
320326
res,
321327
segments: arena_vec![self; hir::PathSegment::new(self.lower_ident(ident), hir_id, res)],
322328
}),
323-
))
329+
)))
324330
}
325331
}
326332
}

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)) | Guard(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)) | Guard(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)),
@@ -1567,9 +1567,6 @@ pub enum PatKind<'hir> {
15671567
/// A never pattern `!`.
15681568
Never,
15691569

1570-
/// A path pattern for a unit struct/variant or a (maybe-associated) constant.
1571-
Path(QPath<'hir>),
1572-
15731570
/// A tuple pattern (e.g., `(a, b)`).
15741571
/// If the `..` pattern fragment is present, then `Option<usize>` denotes its position.
15751572
/// `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

+1-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ 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::PatExprKind::Path(hir::QPath::Resolved(_, path)))
109109
| PatKind::TupleStruct(hir::QPath::Resolved(_, path), ..)
110110
| PatKind::Struct(hir::QPath::Resolved(_, path), ..) => {
111111
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
@@ -703,7 +703,6 @@ fn resolve_local<'tcx>(
703703
| PatKind::Binding(hir::BindingMode(hir::ByRef::No, _), ..)
704704
| PatKind::Wild
705705
| PatKind::Never
706-
| PatKind::Path(_)
707706
| PatKind::Expr(_)
708707
| PatKind::Range(_, _, _)
709708
| PatKind::Err(_) => false,

compiler/rustc_hir_analysis/src/hir_ty_lowering/lint.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,11 @@ impl<'tcx> dyn HirTyLowerer<'tcx> + '_ {
3939
..
4040
})
4141
| hir::Node::Pat(hir::Pat {
42-
kind: hir::PatKind::Path(hir::QPath::TypeRelative(qself, _)),
42+
kind: hir::PatKind::Expr(hir::PatExprKind::Path(hir::QPath::TypeRelative(qself, _))),
43+
..
44+
})
45+
| hir::Node::PatExpr(hir::PatExpr {
46+
kind: hir::PatExprKind::Path(hir::QPath::TypeRelative(qself, _)),
4347
..
4448
}) if qself.hir_id == self_ty.hir_id => true,
4549
_ => 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
@@ -480,7 +480,6 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
480480
hir::PatKind::Binding(_, _, _, _)
481481
| hir::PatKind::Struct(_, _, _)
482482
| hir::PatKind::TupleStruct(_, _, _)
483-
| hir::PatKind::Path(_)
484483
| hir::PatKind::Tuple(_, _)
485484
| hir::PatKind::Box(_)
486485
| hir::PatKind::Ref(_, _)

compiler/rustc_hir_typeck/src/expr_use_visitor.rs

+3-5
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, 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,7 +563,7 @@ 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(PatExprKind::Path(qpath)) => {
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

@@ -1801,8 +1800,7 @@ impl<'tcx, Cx: TypeInformationCtxt<'tcx>, D: Delegate<'tcx>> ExprUseVisitor<'tcx
18011800
}
18021801
}
18031802

1804-
PatKind::Path(_)
1805-
| PatKind::Binding(.., None)
1803+
PatKind::Binding(.., None)
18061804
| PatKind::Expr(..)
18071805
| PatKind::Range(..)
18081806
| 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, 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;
@@ -1419,8 +1419,8 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
14191419
// since the user probably just misunderstood how `let else`
14201420
// and `&&` work together.
14211421
if let Some((_, hir::Node::LetStmt(local))) = cond_parent
1422-
&& let hir::PatKind::Path(qpath) | hir::PatKind::TupleStruct(qpath, _, _) =
1423-
&local.pat.kind
1422+
&& let hir::PatKind::Expr(PatExprKind::Path(qpath))
1423+
| hir::PatKind::TupleStruct(qpath, _, _) = &local.pat.kind
14241424
&& let hir::QPath::Resolved(None, path) = qpath
14251425
&& let Some(did) = path
14261426
.res

compiler/rustc_hir_typeck/src/method/suggest.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -177,9 +177,9 @@ 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), ..)
182-
| hir::PatKind::TupleStruct(QPath::TypeRelative(rcvr, segment), ..),
180+
hir::PatKind::Struct(QPath::TypeRelative(rcvr, segment), ..)
181+
| hir::PatKind::TupleStruct(QPath::TypeRelative(rcvr, segment), ..)
182+
| hir::PatKind::Expr(hir::PatExprKind::Path(QPath::TypeRelative(rcvr, segment))),
183183
span,
184184
..
185185
}) => {

compiler/rustc_hir_typeck/src/pat.rs

+19-19
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, PatExprKind,
15+
PatKind, expr_needs_parens,
1616
};
1717
use rustc_infer::infer;
1818
use rustc_middle::traits::PatternOriginExpr;
@@ -250,8 +250,8 @@ 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) => {
253+
let path_res = match pat.kind {
254+
PatKind::Expr(PatExprKind::Path(ref qpath)) => {
255255
Some(self.resolve_ty_and_res_fully_qualified_call(qpath, pat.hir_id, pat.span))
256256
}
257257
_ => None,
@@ -271,6 +271,9 @@ 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(PatExprKind::Path(ref qpath)) => {
275+
self.check_pat_path(pat.hir_id, pat.span, qpath, path_res.unwrap(), expected, ti)
276+
}
274277
PatKind::Expr(ref lt) => {
275278
self.check_pat_lit(pat.hir_id, pat.span, lt, expected, ti, opt_expr_ty.unwrap())
276279
}
@@ -281,9 +284,6 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
281284
PatKind::TupleStruct(ref qpath, subpats, ddpos) => {
282285
self.check_pat_tuple_struct(pat, qpath, subpats, ddpos, expected, pat_info)
283286
}
284-
PatKind::Path(ref qpath) => {
285-
self.check_pat_path(pat.hir_id, pat.span, qpath, path_res.unwrap(), expected, ti)
286-
}
287287
PatKind::Struct(ref qpath, fields, has_rest_pat) => {
288288
self.check_pat_struct(pat, qpath, fields, has_rest_pat, expected, pat_info)
289289
}
@@ -402,6 +402,18 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
402402
| PatKind::Slice(..) => AdjustMode::Peel,
403403
// A never pattern behaves somewhat like a literal or unit variant.
404404
PatKind::Never => AdjustMode::Peel,
405+
PatKind::Expr(PatExprKind::Path(_)) => match opt_path_res.unwrap() {
406+
// These constants can be of a reference type, e.g. `const X: &u8 = &0;`.
407+
// Peeling the reference types too early will cause type checking failures.
408+
// Although it would be possible to *also* peel the types of the constants too.
409+
Res::Def(DefKind::Const | DefKind::AssocConst, _) => AdjustMode::Pass,
410+
// In the `ValueNS`, we have `SelfCtor(..) | Ctor(_, Const), _)` remaining which
411+
// could successfully compile. The former being `Self` requires a unit struct.
412+
// In either case, and unlike constants, the pattern itself cannot be
413+
// a reference type wherefore peeling doesn't give up any expressiveness.
414+
_ => AdjustMode::Peel,
415+
},
416+
405417
// String and byte-string literals result in types `&str` and `&[u8]` respectively.
406418
// All other literals result in non-reference types.
407419
// As a result, we allow `if let 0 = &&0 {}` but not `if let "foo" = &&"foo" {}`.
@@ -415,17 +427,6 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
415427
};
416428
return (adjust, Some(ty))
417429
},
418-
PatKind::Path(_) => match opt_path_res.unwrap() {
419-
// These constants can be of a reference type, e.g. `const X: &u8 = &0;`.
420-
// Peeling the reference types too early will cause type checking failures.
421-
// Although it would be possible to *also* peel the types of the constants too.
422-
Res::Def(DefKind::Const | DefKind::AssocConst, _) => AdjustMode::Pass,
423-
// In the `ValueNS`, we have `SelfCtor(..) | Ctor(_, Const), _)` remaining which
424-
// could successfully compile. The former being `Self` requires a unit struct.
425-
// In either case, and unlike constants, the pattern itself cannot be
426-
// a reference type wherefore peeling doesn't give up any expressiveness.
427-
_ => AdjustMode::Peel,
428-
},
429430
// Ref patterns are complicated, we handle them in `check_pat_ref`.
430431
PatKind::Ref(..) => AdjustMode::Pass,
431432
// A `_` pattern works with any expected type, so there's no need to do anything.
@@ -952,7 +953,6 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
952953
PatKind::Wild
953954
| PatKind::Never
954955
| PatKind::Binding(..)
955-
| PatKind::Path(..)
956956
| PatKind::Box(..)
957957
| PatKind::Deref(_)
958958
| PatKind::Ref(..)

compiler/rustc_lint/src/internal.rs

+5-7
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ use rustc_ast as ast;
55
use rustc_hir::def::Res;
66
use rustc_hir::def_id::DefId;
77
use rustc_hir::{
8-
BinOp, BinOpKind, Expr, ExprKind, GenericArg, HirId, Impl, Item, ItemKind, Node, Pat, PatKind,
9-
Path, PathSegment, QPath, Ty, TyKind,
8+
BinOp, BinOpKind, Expr, ExprKind, GenericArg, HirId, Impl, Item, ItemKind, Node, Pat, PatExpr,
9+
PatExprKind, PatKind, 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

+2-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, 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,7 @@ 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(PatExprKind::Path(hir::QPath::Resolved(None, path))) = p.kind {
531531
if let Res::Def(DefKind::Const, _) = path.res {
532532
if let [segment] = path.segments {
533533
NonUpperCaseGlobals::check_upper_case(

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

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

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

compiler/rustc_passes/src/dead.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,10 @@ use hir::def_id::{LocalDefIdMap, LocalDefIdSet};
1010
use rustc_abi::FieldIdx;
1111
use rustc_data_structures::unord::UnordSet;
1212
use rustc_errors::MultiSpan;
13-
use rustc_hir as hir;
1413
use rustc_hir::def::{CtorOf, DefKind, Res};
1514
use rustc_hir::def_id::{DefId, LocalDefId, LocalModDefId};
1615
use rustc_hir::intravisit::{self, Visitor};
17-
use rustc_hir::{Node, PatKind, TyKind};
16+
use rustc_hir::{self as hir, Node, PatExprKind, PatKind, TyKind};
1817
use rustc_middle::middle::codegen_fn_attrs::CodegenFnAttrFlags;
1918
use rustc_middle::middle::privacy::Level;
2019
use rustc_middle::query::Providers;
@@ -637,7 +636,7 @@ impl<'tcx> Visitor<'tcx> for MarkSymbolVisitor<'tcx> {
637636
let res = self.typeck_results().qpath_res(path, pat.hir_id);
638637
self.handle_field_pattern_match(pat, res, fields);
639638
}
640-
PatKind::Path(ref qpath) => {
639+
PatKind::Expr(PatExprKind::Path(ref qpath)) => {
641640
let res = self.typeck_results().qpath_res(qpath, pat.hir_id);
642641
self.handle_res(res);
643642
}

compiler/rustc_passes/src/input_stats.rs

-1
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,6 @@ impl<'v> hir_visit::Visitor<'v> for StatCollector<'v> {
299299
TupleStruct,
300300
Or,
301301
Never,
302-
Path,
303302
Tuple,
304303
Box,
305304
Deref,

src/librustdoc/clean/utils.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,9 @@ pub(crate) fn name_from_pat(p: &hir::Pat<'_>) -> Symbol {
303303
return kw::Underscore;
304304
}
305305
PatKind::Binding(_, _, ident, _) => return ident.name,
306-
PatKind::TupleStruct(ref p, ..) | PatKind::Path(ref p) => qpath_to_string(p),
306+
PatKind::TupleStruct(ref p, ..) | PatKind::Expr(PatExprKind::Path(ref p)) => {
307+
qpath_to_string(p)
308+
}
307309
PatKind::Or(pats) => {
308310
pats.iter().map(|p| name_from_pat(p).to_string()).collect::<Vec<String>>().join(" | ")
309311
}

0 commit comments

Comments
 (0)