]> git.lizzy.rs Git - rust.git/commitdiff
Auto merge of #32479 - eddyb:eof-not-even-twice, r=nikomatsakis
authorbors <bors@rust-lang.org>
Tue, 29 Mar 2016 03:50:42 +0000 (20:50 -0700)
committerbors <bors@rust-lang.org>
Tue, 29 Mar 2016 03:50:42 +0000 (20:50 -0700)
Prevent bumping the parser past the EOF.

Makes `Parser::bump` after EOF into an ICE, forcing callers to avoid repeated EOF bumps.
This ICE is intended to break infinite loops where EOF wasn't stopping the loop.

For example, the handling of EOF in `parse_trait_items`' recovery loop fixes #32446.
But even without this specific fix, the ICE is triggered, which helps diagnosis and UX.

This is a `[breaking-change]` for plugins authors who eagerly eat multiple EOFs.
See https://github.com/docopt/docopt.rs/pull/171 for such an example and the necessary fix.


No differences found