diff options
| author | Mark Rousskov <mark.simulacrum@gmail.com> | 2019-07-23 12:51:07 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-07-23 12:51:07 -0400 |
| commit | ab7149bdc5da8b982f99acf619c6336b45cde552 (patch) | |
| tree | f36748a48aff41c834566c4875927d7597a78b08 /src/libsyntax_ext | |
| parent | 4264f8376a8187fa3404391bac6436b1123af42a (diff) | |
| parent | 9dbe2e77b34f5321976ee3b26ca008ad8d574faf (diff) | |
| download | rust-ab7149bdc5da8b982f99acf619c6336b45cde552.tar.gz rust-ab7149bdc5da8b982f99acf619c6336b45cde552.zip | |
Rollup merge of #62791 - estebank:type-ascription, r=petrochenkov
Handle more cases of typos misinterpreted as type ascription Fix #60933, #54516. CC #47666, #34255, #48016.
Diffstat (limited to 'src/libsyntax_ext')
| -rw-r--r-- | src/libsyntax_ext/format.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/libsyntax_ext/format.rs b/src/libsyntax_ext/format.rs index 2d296147a1f..e53660b6568 100644 --- a/src/libsyntax_ext/format.rs +++ b/src/libsyntax_ext/format.rs @@ -141,7 +141,10 @@ fn parse_args<'a>( while p.token != token::Eof { if !p.eat(&token::Comma) { - return Err(ecx.struct_span_err(p.token.span, "expected token: `,`")); + let mut err = ecx.struct_span_err(p.token.span, "expected token: `,`"); + err.span_label(p.token.span, "expected `,`"); + p.maybe_annotate_with_ascription(&mut err, false); + return Err(err); } if p.token == token::Eof { break; |
