Skip to content

Commit

Permalink
Change camel case warning to upper camel case
Browse files Browse the repository at this point in the history
Rust structs should be named in upper camel case aka PascalCase. “Upper camel case” was decided upon as the preferred phrase over PascalCase per: rust-lang/rfcs#2389
  • Loading branch information
tcullum-gpsw committed Jan 4, 2019
1 parent c6ac70c commit 071363d
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/test/ui/lint/lint-non-camel-case-types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,31 +2,31 @@
#![allow(dead_code)]

struct ONE_TWO_THREE;
//~^ ERROR type `ONE_TWO_THREE` should have a camel case name such as `OneTwoThree`
//~^ ERROR type `ONE_TWO_THREE` should have an upper camel case name such as `OneTwoThree`

struct foo { //~ ERROR type `foo` should have a camel case name such as `Foo`
struct foo { //~ ERROR type `foo` should have an upper camel case name such as `Foo`
bar: isize,
}

enum foo2 { //~ ERROR type `foo2` should have a camel case name such as `Foo2`
enum foo2 { //~ ERROR type `foo2` should have an upper camel case name such as `Foo2`
Bar
}

struct foo3 { //~ ERROR type `foo3` should have a camel case name such as `Foo3`
struct foo3 { //~ ERROR type `foo3` should have an upper camel case name such as `Foo3`
bar: isize
}

type foo4 = isize; //~ ERROR type `foo4` should have a camel case name such as `Foo4`
type foo4 = isize; //~ ERROR type `foo4` should have an upper camel case name such as `Foo4`

enum Foo5 {
bar //~ ERROR variant `bar` should have a camel case name such as `Bar`
bar //~ ERROR variant `bar` should have an upper camel case name such as `Bar`
}

trait foo6 { //~ ERROR trait `foo6` should have a camel case name such as `Foo6`
trait foo6 { //~ ERROR trait `foo6` should have an upper camel case name such as `Foo6`
fn dummy(&self) { }
}

fn f<ty>(_: ty) {} //~ ERROR type parameter `ty` should have a camel case name such as `Ty`
fn f<ty>(_: ty) {} //~ ERROR type parameter `ty` should have an upper camel case name such as `Ty`

#[repr(C)]
struct foo7 {
Expand All @@ -35,10 +35,10 @@ struct foo7 {

struct X86_64;

struct X86__64; //~ ERROR type `X86__64` should have a camel case name such as `X86_64`
struct X86__64; //~ ERROR type `X86__64` should have an upper camel case name such as `X86_64`

struct Abc_123; //~ ERROR type `Abc_123` should have a camel case name such as `Abc123`
struct Abc_123; //~ ERROR type `Abc_123` should have an upper camel case name such as `Abc123`

struct A1_b2_c3; //~ ERROR type `A1_b2_c3` should have a camel case name such as `A1B2C3`
struct A1_b2_c3; //~ ERROR type `A1_b2_c3` should have an upper camel case name such as `A1B2C3`

fn main() { }

0 comments on commit 071363d

Please sign in to comment.