Skip to content

Add compiler warning for double semicolon #60876

Closed
@hellow554

Description

@hellow554

This could should emit an error:

pub fn foo() {
    return;;
}

I think something similar to this would be a good one:

warning: redundant `;` detected
 --> src/main.rs:X:XX
  |
LL|         return;;
  |                ^
  |                |
  |                help: remove this `;` (this should be a suggestion so rustfix can fix it automatically)

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.C-enhancementCategory: An issue proposing an enhancement or a PR with one.E-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.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions