Skip to content

error causes subsequent spurious error about literal cast #35772

Closed
@durka

Description

@durka

See this code:

fn main() {
    error;
    1 as f32;
}

It has an error on the second line, obviously. But it also prints an error about the third line (illegal cast). But the cast is perfectly legal and removing the first error also "fixes" the second one.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsC-bugCategory: This is a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions