Commit Graph

21 Commits

Author SHA1 Message Date
Ariel Ben-Yehuda
77f4022303 Revert "Change error count messages"
This reverts commit 5558c64f33.
2017-07-02 13:49:30 +03:00
Guillaume Gomez
e8cbb53309 Add E0613 2017-06-15 10:14:29 +02:00
Guillaume Gomez
a42f8160ed Add E0612 2017-06-15 10:14:29 +02:00
Guillaume Gomez
2f37894740 Add E0610 2017-06-12 01:47:01 +02:00
Guillaume Gomez
f4dd365bbb Add E0609 2017-06-11 19:48:53 +02:00
bors
cb7c60f2a0 Auto merge of #42264 - GuillaumeGomez:new-error-codes, r=Susurrus
New error codes

Part of #42229.
2017-05-29 21:55:57 +00:00
Guillaume Gomez
998b19740c Add new error codes and update tests 2017-05-27 19:58:52 +02:00
bors
9337ad5bae Auto merge of #42103 - jorendorff:master, r=estebank
trace_macro: Show both the macro call and its expansion. #42072.

See #42072 for the initial motivation behind this.

The change is not the minimal fix, but I want this behavior almost every time I use `trace_macros`.
2017-05-27 17:38:11 +00:00
Michael Kohl
5558c64f33 Change error count messages
See #33525 for details.
2017-05-24 16:14:38 +07:00
Jason Orendorff
f8b66a001d trace_macro: Show both the macro call and its expansion. #42072. 2017-05-19 13:43:06 -05:00
Esteban Küber
8c9ad8d72c Group "macro expansion" notes per call span 2017-05-06 00:55:42 -07:00
Esteban Küber
56411443f2 Use diagnostics for trace_macro instead of println 2017-05-05 15:51:48 -07:00
Jeffrey Seyfried
f08d5ad4c5 Refactor how spans are combined in the parser. 2017-03-29 11:17:59 +00:00
Zack M. Davis
65435e14fe improve error message when two-arg assert_eq! receives a trailing comma
Previously, `assert_eq!(left, right,)` (respectively, `assert_ne!(left,
right,)`; note the trailing comma) would result in a confusing "requires
at least a format string argument" error. In reality, a format string is
optional, but the trailing comma puts us into the "match a token tree of
zero or more tokens" branch of the macro (in order to support the
optional format string), and passing the empty token tree into
`format_args!` results in the confusing error. If instead we match a
token tree of one or more tokens, we get a much more sensible
"unexpected end of macro invocation" error.

While we're here, fix up a stray space before a comma in the match
guards.

Resolves #39369.
2017-02-06 22:33:09 -08:00
Vadim Petrochenkov
2092682191 resolve: Do not use "resolve"/"resolution" in error messages 2017-01-12 10:08:27 +03:00
Vadim Petrochenkov
09aba18e10 More systematic error reporting in path resolution 2016-12-26 15:01:49 +03:00
Kalita Alexey
12a6cf1123 Allow path fragments to be parsed as type parameter bounds in macro expansion 2016-12-16 14:16:46 +03:00
Daniel Keep
455723c638 Add foreign formatting directive detection.
This teaches `format_args!` how to interpret format printf- and
shell-style format directives.  This is used in cases where there are
unused formatting arguments, and the reason for that *might* be because
the programmer is trying to use the wrong kind of formatting string.

This was prompted by an issue encountered by simulacrum on the #rust IRC
channel.  In short: although `println!` told them that they weren't using
all of the conversion arguments, the problem was in using printf-syle
directives rather than ones `println!` would undertand.

Where possible, `format_args!` will tell the programmer what they should
use instead.  For example, it will suggest replacing `%05d` with `{:0>5}`,
or `%2$.*3$s` with `{1:.3$}`.  Even if it cannot suggest a replacement,
it will explicitly note that Rust does not support that style of directive,
and direct the user to the `std::fmt` documentation.
2016-11-11 15:23:15 +11:00
Gavin Baker
99aae9b834 Improve error message and snippet for "did you mean x"
- Fixes #36164
- Part of #35233
- handles unknown fields
- uses UI-style tests
- update all related tests (cfail, ui, incremental)
2016-10-02 15:57:39 +11:00
Jonathan Turner
2fa91b23c5 Update E0425, E0446, E0449 2016-09-26 16:05:46 -07:00
Jonathan Turner
61865384b8 Replace local backtrace with def-use, repair std macro spans 2016-08-17 14:26:14 -07:00