]> git.lizzy.rs Git - rust.git/commitdiff
Rollup merge of #51629 - topecongiro:multiple-semicolon-in-local-span, r=petrochenkov
authorkennytm <kennytm@gmail.com>
Fri, 22 Jun 2018 08:50:41 +0000 (16:50 +0800)
committerGitHub <noreply@github.com>
Fri, 22 Jun 2018 08:50:41 +0000 (16:50 +0800)
Do not consume semicolon twice while parsing local statement

The span for a `let` statement includes multiple semicolons. For example,

```rust
    let x = 2;;;
//  ^^^^^^^^^^^ The span for the above statement.
```

This PR fixes it.

cc https://github.com/rust-lang-nursery/rustfmt/issues/2791.

1  2 
src/libsyntax/parse/parser.rs

Simple merge