Skip to content

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

Closed
@dwrensha

Description

@dwrensha

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).

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.I-ICEIssue: The compiler panicked, giving an Internal Compilation Error (ICE) ❄️T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions