Skip to content

1.18.0 and nightly ICE on invalid code: attempted to bump the parser past EOF (may be stuck in a loop)  #43196

Closed
@zhendongsu

Description

@zhendongsu
$ rustc --version
rustc 1.20.0-nightly (bf0a9e0b4 2017-07-10)
$ 
$ rustc tmp.rs
error: expected expression, found `<eof>`
 --> tmp.rs:1:26
  |
1 | fn main () { let x = | } |
  |                          ^

error: internal compiler error: attempted to bump the parser past EOF (may be stuck in a loop)
 --> tmp.rs:1:26
  |
1 | fn main () { let x = | } |
  |                          ^

error: aborting due to 2 previous errors

$ 
$ rustc-1.18.0 tmp.rs
error: expected expression, found `<eof>`
 --> tmp.rs:1:26
  |
1 | fn main () { let x = | } |
  |                          ^

error: internal compiler error: attempted to bump the parser past EOF (may be stuck in a loop)
 --> tmp.rs:1:26
  |
1 | fn main () { let x = | } |
  |                          ^

error: aborting due to 2 previous errors

$ 
$ cat tmp.rs
fn main () { let x = | } |
$ 

Activity

added
A-parserArea: The lexing & parsing of Rust source code to an AST
I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
on Jul 12, 2017
DanielJin21

DanielJin21 commented on Aug 8, 2017

@DanielJin21

Even more minimal test case: fn main() { | } |

The parser for some reason is expecting a pattern by end of the second |.

goffrie

goffrie commented on Oct 8, 2017

@goffrie
Contributor

The ICE is fixed in nightly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-parserArea: The lexing & parsing of Rust source code to an ASTC-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @goffrie@sfackler@Mark-Simulacrum@zhendongsu@DanielJin21

        Issue actions

          1.18.0 and nightly ICE on invalid code: attempted to bump the parser past EOF (may be stuck in a loop) · Issue #43196 · rust-lang/rust