about summary refs log tree commit diff
path: root/src/rustllvm/RustWrapper.cpp
diff options
context:
space:
mode:
authorZack M. Davis <code@zackmdavis.net>2017-02-04 22:47:46 -0800
committerZack M. Davis <code@zackmdavis.net>2017-02-06 22:33:09 -0800
commit65435e14febd9d8aa1d40a19cd1adb427263c48e (patch)
tree87d7277d88a1b0603863c8eed608fceabd000c66 /src/rustllvm/RustWrapper.cpp
parentd7777ae682d498ff43e3d6b65a7a8d0b2361fa0b (diff)
downloadrust-65435e14febd9d8aa1d40a19cd1adb427263c48e.tar.gz
rust-65435e14febd9d8aa1d40a19cd1adb427263c48e.zip
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.
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions