Skip to content

"consider removing this semicolon" note appears before the corresponding error #13279

Closed
@huonw

Description

@huonw
fn foo() -> int { 1; }
fn main() {}

emits an error like

<anon>:11:28: 11:28 note: consider removing this semicolon:
<anon>:11         fn foo() -> int { 1; }
                                     ^
<anon>:11:9: 11:31 error: not all control paths return a value
<anon>:11         fn foo() -> int { 1; }
                  ^~~~~~~~~~~~~~~~~~~~~~

This could be mildly confusing when there are multiple error messages, and so someone may misinterpret some note as being attached to a previous error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsE-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.E-mentorCall for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions