Skip to content

Parsing bug in 02/22 nightly #58962

Description

@nipunn1313

Haven't confirmed if it has been fixed since 02/22

pub fn f<F: FnOnce(u64) -> u64>(f1: F) -> u64 {
        f1(1)
}

#[test]
fn test_weird_rustc_thing() {
    let y = f({
        |x| x+1
    ); // shouldn't this need a closing curly brace?
    assert_eq!(y, 2);
    println!("WEIRD RUSTC BUG");
}

Seems to only repro inside an inner mod.

Here's a link to a repro
https://github.com/nipunn1313/rustc_parser_bug

Activity

  1. added
    A-parserArea: The lexing & parsing of Rust source code to an AST
    on Mar 6, 2019
  2. estebank commented on Mar 6, 2019

    @estebank
    Contributor

    Introduced in #57944. Will be fixed in #58903. Duplicate of #58886.

  3. nipunn1313 commented on Mar 6, 2019

    @nipunn1313
    ContributorAuthor

    Thanks! #57944 looks pretty great. Especially given the test case on the fix https://github.com/rust-lang/rust/pull/58903/files#diff-44324609d226c76463a9b78f62aba74d !!

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 AST

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions