Skip to content

Internal Compiler Error: attempted to bump the parser past EOF (may be stuck in a loop) #84117

New issue

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

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

Already on GitHub? # to your account

Closed
dwrensha opened this issue Apr 12, 2021 · 0 comments · Fixed by #84140
Closed
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Comments

@dwrensha
Copy link
Contributor

I'm seeing an internal compiler error on the following input (found by fuzz-rustc):

fn main() {
    let _:e<&str, { let _:e<&str, }
}
$ rustc bug.rs
error: expected one of `>`, a const expression, lifetime, or type, found `}`
 --> bug.rs:2:35
  |
2 |     let _:e<&str, { let _:e<&str, }
  |                         --        ^ expected one of `>`, a const expression, lifetime, or type
  |                         ||
  |                         |help: use `=` if you meant to assign
  |                         while parsing the type for `_`

error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, or an operator, found `,`
 --> bug.rs:2:33
  |
2 |     let _:e<&str, { let _:e<&str, }
  |                                 ^ expected one of 7 possible tokens

error: expected one of `,`, `:`, `=`, or `>`, found `<eof>`
 --> bug.rs:3:1
  |
2 |     let _:e<&str, { let _:e<&str, }
  |         -- help: use `=` if you meant to assign
  |         |
  |         while parsing the type for `_`
3 | }
  | ^ expected one of `,`, `:`, `=`, or `>`

error: expected one of `!`, `.`, `::`, `;`, `?`, `{`, or an operator, found `,`
 --> bug.rs:2:17
  |
2 |     let _:e<&str, { let _:e<&str, }
  |                 ^ expected one of 7 possible tokens

error: internal compiler error: attempted to bump the parser past EOF (may be stuck in a loop)
 --> bug.rs:3:1
  |
3 | }
  | ^

thread 'rustc' panicked at 'Box<Any>', /rustc/a836d9b6413d9d593be6c09463ff8c4c70e56599/library/std/src/panic.rs:59:5
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

note: the compiler unexpectedly panicked. this is a bug.

note: we would appreciate a bug report: https://github.com/rust-lang/rust/issues/new?labels=C-bug%2C+I-ICE%2C+T-compiler&template=ice.md

note: rustc 1.53.0-nightly (a836d9b64 2021-04-10) running on x86_64-unknown-linux-gnu

query stack during panic:
end of query stack
error: aborting due to 5 previous errors

The ICE happens with nightly and beta rustc, but not with current stable rustc (1.51.0).

@dwrensha dwrensha added C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Apr 12, 2021
@bors bors closed this as completed in e40d7e6 Apr 13, 2021
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
C-bug Category: This is a bug. I-ICE Issue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️ T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant