Skip to content

Span note for last semicolon points at one space after the last expression rather than at the semicolon #11714

Closed
@ktt3ja

Description

@ktt3ja

This function

fn blah() -> int {
    1  ;
}

yields the following messages:

test2.rs:2:6: 2:6 note: consider removing this semicolon:
test2.rs:2     1  ;
                ^
test2.rs:1:1: 3:2 error: not all control paths return a value
test2.rs:1 fn blah() -> int {
test2.rs:2     1  ;
test2.rs:3 }
error: aborting due to previous error

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsE-needs-testCall for participation: An issue has been fixed and does not reproduce, but no test has been added.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions