]> git.lizzy.rs Git - rust.git/commit
Auto merge of #42578 - estebank:recover-binop, r=nikomatsakis
authorbors <bors@rust-lang.org>
Fri, 16 Jun 2017 03:31:09 +0000 (03:31 +0000)
committerbors <bors@rust-lang.org>
Fri, 16 Jun 2017 03:31:09 +0000 (03:31 +0000)
commit44eeb2109b249e7496ca0897ce509ced2e3b6c81
tree12e53491ade7b4815bc59f7b83e29eda605a5685
parenta3114961a1c6b8a16cd06a854d585377ac576d47
parentad260ffc884477686e8f6f52c97a417bf99e2f19
Auto merge of #42578 - estebank:recover-binop, r=nikomatsakis

Learn to parse `a as usize < b`

Parsing `a as usize > b` always works, but `a as usize < b` was a
parsing error because the parser would think the `<` started a generic
type argument for `usize`. The parser now attempts to parse as before,
and if a DiagnosticError is returned, try to parse again as a type with
no generic arguments. If this fails, return the original
`DiagnosticError`.

Fix #22644.
src/libsyntax/parse/parser.rs