Skip to content

Naming convention for static mut is not enforced #37145

Closed

Description

@matklad

The following program does not report any naming convention warnings:

#![allow(dead_code)]

static mut snake_case: u32 = 0;
static mut camelCase: u32 = 0;
static mut SCREAMING_SNAKE_CASE: u32 = 0;
static mut CapitalizedCamelCase: u32 = 0;

fn main() {}

Looks like only SCREAMING_SNAKE_CASE should be allowed? If I remove muts, I get the warnings. Or have we already deprecated static muts (pre rfc: https://internals.rust-lang.org/t/pre-rfc-remove-static-mut/1437/20) ?

Activity

  1. added
    A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.
    on Oct 13, 2016
  2. sfackler commented on Oct 14, 2016

    @sfackler
    Member

    Static muts are not deprecated. This looks like it's just an oversight in those lints. The convention should be identical to normal statics.

  3. matklad commented on Oct 14, 2016

    @matklad
    ContributorAuthor

    Ok, I'll try to submit a PR then.

  4. added a commit that references this issue on Oct 17, 2016
    07b86d0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions