]> git.lizzy.rs Git - rust.git/commit
Rollup merge of #45639 - LaurentMazare:master, r=petrochenkov
authorkennytm <kennytm@gmail.com>
Sat, 4 Nov 2017 05:49:28 +0000 (13:49 +0800)
committerGitHub <noreply@github.com>
Sat, 4 Nov 2017 05:49:28 +0000 (13:49 +0800)
commitea572657daea279bca23cad44f3489a9d4d2985e
treee147ed0726ced6d25c7230544465fefc294c7983
parentae512c4144a8cb2de048ff91895357d9fb5199c3
parented20f3b5c0ae32802450c77da5c94c239c3a3500
Rollup merge of #45639 - LaurentMazare:master, r=petrochenkov

Add a nicer error message for missing  in for loop, fixes #40782.

As suggested by @estebank in issue #40782, this works in the same way as #42578: if the in keyword is missing, we continue parsing the expression and if this works correctly an adapted error message is produced. Otherwise we return the old error.

A specific test case has also been added.
This is my first PR on rust-lang/rust so any feedback is very welcome.
src/libsyntax/parse/parser.rs