]> git.lizzy.rs Git - rust.git/commitdiff
Fix match ergonomics suggestion
authorMatthew Jasper <mjjasper1@gmail.com>
Sun, 5 May 2019 16:32:52 +0000 (17:32 +0100)
committerMatthew Jasper <mjjasper1@gmail.com>
Tue, 21 May 2019 18:37:39 +0000 (19:37 +0100)
src/librustc_typeck/check/_match.rs

index 99b350b833274ddb78e68d0673bd3870ad155d43..e4b431e6e68f17bc653196b4818d043680b3d13c 100644 (file)
@@ -540,7 +540,7 @@ fn borrow_pat_suggestion(
                         err.help(&format!("did you mean `{}: &{}`?", snippet, expected));
                     }
                 }
-                hir::Node::Expr(hir::Expr { node: hir::ExprKind::Match(..), .. }) |
+                hir::Node::Arm(_) |
                 hir::Node::Pat(_) => {
                     // rely on match ergonomics or it might be nested `&&pat`
                     if let Ok(snippet) = tcx.sess.source_map().span_to_snippet(inner.span) {