summary refs log tree commit diff
path: root/src/test/ui/macros
AgeCommit message (Collapse)AuthorLines
2017-03-29Refactor how spans are combined in the parser.Jeffrey Seyfried-4/+1
2017-02-06improve error message when two-arg assert_eq! receives a trailing commaZack M. Davis-0/+38
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-01-12resolve: Do not use "resolve"/"resolution" in error messagesVadim Petrochenkov-4/+4
2016-12-26More systematic error reporting in path resolutionVadim Petrochenkov-4/+4
2016-12-16Allow path fragments to be parsed as type parameter bounds in macro expansionKalita Alexey-0/+30
2016-11-11Add foreign formatting directive detection.Daniel Keep-0/+72
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-10-02Improve error message and snippet for "did you mean `x`"Gavin Baker-6/+6
- Fixes #36164 - Part of #35233 - handles unknown fields - uses UI-style tests - update all related tests (cfail, ui, incremental)
2016-09-26Update E0425, E0446, E0449Jonathan Turner-2/+2
2016-08-17Replace local backtrace with def-use, repair std macro spansJonathan Turner-0/+223