Skip to content
/ rust Public
forked from rust-lang/rust

Commit 9ee1695

Browse files
committed
Merge some patterns together
1 parent 37e7459 commit 9ee1695

File tree

1 file changed

+5
-21
lines changed

1 file changed

+5
-21
lines changed

compiler/rustc_lint/src/internal.rs

+5-21
Original file line numberDiff line numberDiff line change
@@ -170,27 +170,11 @@ impl<'tcx> LateLintPass<'tcx> for TyTyKind {
170170
| PatKind::TupleStruct(qpath, ..)
171171
| PatKind::Struct(qpath, ..),
172172
..
173-
}) => {
174-
if let QPath::TypeRelative(qpath_ty, ..) = qpath
175-
&& qpath_ty.hir_id == ty.hir_id
176-
{
177-
Some(path.span)
178-
} else {
179-
None
180-
}
181-
}
182-
Node::Expr(Expr { kind: ExprKind::Path(qpath), .. }) => {
183-
if let QPath::TypeRelative(qpath_ty, ..) = qpath
184-
&& qpath_ty.hir_id == ty.hir_id
185-
{
186-
Some(path.span)
187-
} else {
188-
None
189-
}
190-
}
191-
// Can't unify these two branches because qpath below is `&&` and above is `&`
192-
// and `A | B` paths don't play well together with adjustments, apparently.
193-
Node::Expr(Expr { kind: ExprKind::Struct(qpath, ..), .. }) => {
173+
})
174+
| Node::Expr(
175+
Expr { kind: ExprKind::Path(qpath), .. }
176+
| &Expr { kind: ExprKind::Struct(qpath, ..), .. },
177+
) => {
194178
if let QPath::TypeRelative(qpath_ty, ..) = qpath
195179
&& qpath_ty.hir_id == ty.hir_id
196180
{

0 commit comments

Comments
 (0)