Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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 opened this issue Jul 12, 2017 · 2 comments
Labels
A-parser Area: The parsing of Rust source code to an AST C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️

Comments

@zhendongsu
Copy link

$ 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 = | } |
$ 
@sfackler sfackler added A-parser Area: The parsing of Rust source code to an AST I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ labels Jul 12, 2017
@Mark-Simulacrum Mark-Simulacrum added the C-bug Category: This is a bug. label Jul 22, 2017
@DanielJin21
Copy link

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

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

@goffrie
Copy link
Contributor

goffrie commented Oct 8, 2017

The ICE is fixed in nightly.

wesleywiser added a commit to wesleywiser/rust that referenced this issue Jul 20, 2018
wesleywiser added a commit to wesleywiser/rust that referenced this issue Jul 20, 2018
@bors bors closed this as completed in 3290774 Jul 26, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-parser Area: The parsing of Rust source code to an AST C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️
Projects
None yet
Development

No branches or pull requests

5 participants