diff options
| author | bors <bors@rust-lang.org> | 2018-06-25 13:43:22 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2018-06-25 13:43:22 +0000 |
| commit | 8acec1f9d0b40dde142e6c26d7358b9ab232d2b4 (patch) | |
| tree | ee8312ba11e731b1ea6c6e277c8dd9bfb36fc312 /src/libsyntax/parse | |
| parent | ecfe37056fa2abc79a4b97ff1c651fae47f66845 (diff) | |
| parent | 0b39a82cf49bc376e568560e4f97360f477255d4 (diff) | |
| download | rust-8acec1f9d0b40dde142e6c26d7358b9ab232d2b4.tar.gz rust-8acec1f9d0b40dde142e6c26d7358b9ab232d2b4.zip | |
Auto merge of #51750 - zackmdavis:superstructure, r=oli-obk
three diagnostics upgrades * reword `...` expression syntax error to not imply that you should use it in patterns either (#51043) and make it a structured suggestion * shorten the top-line message for the trivial-casts lint by tucking the advisory sentence into a help note * structured suggestion for pattern-named-the-same-as-variant warning r? @oli-obk
Diffstat (limited to 'src/libsyntax/parse')
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 5970f94b97d..955bdbdcf91 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -4800,12 +4800,14 @@ impl<'a> Parser<'a> { fn err_dotdotdot_syntax(&self, span: Span) { self.diagnostic().struct_span_err(span, { - "`...` syntax cannot be used in expressions" - }).help({ - "Use `..` if you need an exclusive range (a < b)" - }).help({ - "or `..=` if you need an inclusive range (a <= b)" - }).emit(); + "unexpected token: `...`" + }).span_suggestion_with_applicability( + span, "use `..` for an exclusive range", "..".to_owned(), + Applicability::MaybeIncorrect + ).span_suggestion_with_applicability( + span, "or `..=` for an inclusive range", "..=".to_owned(), + Applicability::MaybeIncorrect + ).emit(); } // Parse bounds of a type parameter `BOUND + BOUND + BOUND`, possibly with trailing `+`. |
