Skip to content

Variable name with internal double-underscore gets snake case warning, but leading/trailing does not #19475

Closed
@huonw

Description

@huonw
#![allow(unused_variables)]

fn main() {
    let x__y = 0u;

    let __xy = 0u;
    let xy__ = 0u;
}
doubleunder.rs:4:9: 4:13 warning: variable `x__y` should have a snake case name such as `x_y`, #[warn(non_snake_case)] on by default
doubleunder.rs:4     let x__y = 0u;
                         ^~~~

It seems slightly weird that we are inconsistent.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.C-bugCategory: This is a bug.I-needs-decisionIssue: In need of a decision.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions