about summary refs log tree commit diff
path: root/src/libsyntax/parse
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2019-01-31 03:47:17 +0000
committerbors <bors@rust-lang.org>2019-01-31 03:47:17 +0000
commitf40aaa68278ef0879af5fe7ce077c64c6515ea05 (patch)
tree4e07acbdc12409c4e340f11584f410286872197e /src/libsyntax/parse
parent147311c5fc62537da8eb9c6f69536bec6719d534 (diff)
parent877dee7c67d3300074d485e3ef48984732aa907d (diff)
downloadrust-f40aaa68278ef0879af5fe7ce077c64c6515ea05.tar.gz
rust-f40aaa68278ef0879af5fe7ce077c64c6515ea05.zip
Auto merge of #58016 - Centril:rollup, r=Centril
Rollup of 12 pull requests

Successful merges:

 - #57008 (suggest `|` when `,` founds in invalid match value)
 - #57106 (Mark str::trim.* functions as #[must_use].)
 - #57920 (use `SOURCE_DATE_EPOCH` for man page time if set)
 - #57934 (Introduce into_raw_non_null on Rc and Arc)
 - #57971 (SGX target: improve panic & exit handling)
 - #57980 (Add the edition guide to the bookshelf)
 - #57984 (Improve bug message in check_ty)
 - #57999 (Add MOVBE x86 CPU feature)
 - #58000 (Fixes and cleanups)
 - #58005 (update docs for fix_start/end_matches)
 - #58007 (Don't panic when accessing enum variant ctor using `Self` in match)
 - #58008 (Pass correct arguments to places_conflict)

Failed merges:

r? @ghost
Diffstat (limited to 'src/libsyntax/parse')
-rw-r--r--src/libsyntax/parse/parser.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs
index 65572102c59..514b2952c50 100644
--- a/src/libsyntax/parse/parser.rs
+++ b/src/libsyntax/parse/parser.rs
@@ -4381,9 +4381,14 @@ impl<'a> Parser<'a> {
             if let Ok(seq_snippet) = self.sess.source_map().span_to_snippet(seq_span) {
                 err.span_suggestion(
                     seq_span,
-                    "try adding parentheses",
+                    "try adding parentheses to match on a tuple..",
                     format!("({})", seq_snippet),
                     Applicability::MachineApplicable
+                ).span_suggestion(
+                    seq_span,
+                    "..or a vertical bar to match on multiple alternatives",
+                    format!("{}", seq_snippet.replace(",", " |")),
+                    Applicability::MachineApplicable
                 );
             }
             return Err(err);