]> git.lizzy.rs Git - rust.git/commitdiff
Rollup merge of #105098 - lyming2007:issue-103869-fix, r=eholk
authorMatthias Krüger <matthias.krueger@famsik.de>
Tue, 6 Dec 2022 12:27:41 +0000 (13:27 +0100)
committerGitHub <noreply@github.com>
Tue, 6 Dec 2022 12:27:41 +0000 (13:27 +0100)
propagate the error from parsing enum variant to the parser and emit out

While parsing enum variant, the error message always disappear
Because the error message that emit out is from main error of parser
The information of enum variant disappears while parsing enum variant with error
We only check the syntax of expecting token, i.e, in case https://github.com/rust-lang/rust/issues/103869
It will error it without telling the message that this error is from pasring enum variant.
Propagate the sub-error from parsing enum variant to the main error of parser by chaining it with map_err
Check the sub-error before emitting the main error of parser and attach it.
Fix https://github.com/rust-lang/rust/issues/103869

1  2 
compiler/rustc_parse/src/parser/item.rs