improve error message for unexpected comma token in multiline block

confusing diagnostics, issue #72253

add test for confusing error message, issue-72253


remove is_multiline check, refactor to self.expect(&token:Semi)


update issue-72253 tests


return Ok
This commit is contained in:
Chris Simpkins 2020-05-26 16:52:16 -04:00
parent 914adf04af
commit f384cdcbec
No known key found for this signature in database
GPG key ID: 0D0218A71C9DEB09
3 changed files with 29 additions and 0 deletions

View file

@ -0,0 +1,6 @@
fn main() {
let a = std::process::Command::new("echo")
.arg("1")
,arg("2") //~ ERROR expected one of `.`, `;`, `?`, or an operator, found `,`
.output();
}

View file

@ -0,0 +1,10 @@
error: expected one of `.`, `;`, `?`, or an operator, found `,`
--> $DIR/issue-72253.rs:4:9
|
LL | .arg("1")
| - expected one of `.`, `;`, `?`, or an operator
LL | ,arg("2")
| ^ unexpected token
error: aborting due to previous error