Skip to content

Syntax Error: expected expression #2801

@jyn514

Description

@jyn514

I get incorrect errors on the following code. I think rust-analyzer might not like directives in the middle of a function call.

fn assert_float(s: &str, n: f64) {}

fn main() {
    assert_float(
        "1.797693134862315708e+308L",
        #[allow(clippy::excessive_precision)]
        1.797_693_134_862_315_730_8e+308,
    );
}

shows up right after +308L",:

Syntax Error: expected expression
Syntax Error: expected SEMI

The errors also show up after e+308,.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions