Skip to content

Infinite loop when let is in only token in function body #32537

Closed
@kazagistar

Description

@kazagistar

This works fine in Stable, but is broken in Beta and Nightly:

fn main(){
    let
}

Playground link.

This is the output:

<anon>:3:1: 3:2 error: unexpected token: `<eof>`
<anon>:3 }
         ^
<anon>:3:1: 3:2 error: unexpected token: `<eof>`
<anon>:3 }
         ^
<anon>:3:1: 3:2 error: unexpected token: `<eof>`
<anon>:3 }
         ^

... <snip>

This keeps looping forever, or until the timeout on the playground.

In case it helps, here is the version info:

rustc 1.9.0-nightly (d5a91e695 2016-03-26)
binary: rustc
commit-hash: d5a91e69582b63f19192ad860df0f7a9a8530f56
commit-date: 2016-03-26
host: x86_64-apple-darwin
release: 1.9.0-nightly

Metadata

Metadata

Assignees

No one assigned

    Labels

    T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.regression-from-stable-to-betaPerformance or correctness regression from stable to beta.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions