]> git.lizzy.rs Git - rust.git/blobdiff - src/test/compile-fail/lint-non-camel-case-types.rs
auto merge of #15421 : catharsis/rust/doc-ffi-minor-fixes, r=alexcrichton
[rust.git] / src / test / compile-fail / lint-non-camel-case-types.rs
index 04dc2cebdb62a708700073f5ebc4b0528af332e8..784930003d047570b32b4d7dc027b761983ff824 100644 (file)
@@ -1,24 +1,40 @@
-#[forbid(non_camel_case_types)];
+// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
+// file at the top-level directory of this distribution and at
+// http://rust-lang.org/COPYRIGHT.
+//
+// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
+// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
+// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
+// option. This file may not be copied, modified, or distributed
+// except according to those terms.
 
-struct foo { //~ ERROR type, variant, or trait must be camel case
+#![forbid(non_camel_case_types)]
+#![allow(dead_code)]
+
+struct foo { //~ ERROR type `foo` should have a camel case name such as `Foo`
     bar: int,
 }
 
-enum foo2 { //~ ERROR type, variant, or trait must be camel case
+enum foo2 { //~ ERROR type `foo2` should have a camel case name such as `Foo2`
     Bar
 }
 
-struct foo3 { //~ ERROR type, variant, or trait must be camel case
+struct foo3 { //~ ERROR type `foo3` should have a camel case name such as `Foo3`
     bar: int
 }
 
-type foo4 = int; //~ ERROR type, variant, or trait must be camel case
+type foo4 = int; //~ ERROR type `foo4` should have a camel case name such as `Foo4`
 
 enum Foo5 {
-    bar //~ ERROR type, variant, or trait must be camel case
+    bar //~ ERROR variant `bar` should have a camel case name such as `Bar`
+}
+
+trait foo6 { //~ ERROR trait `foo6` should have a camel case name such as `Foo6`
 }
 
-trait foo6 { //~ ERROR type, variant, or trait must be camel case
+#[repr(C)]
+struct foo7 {
+    bar: int,
 }
 
-fn main() { }
\ No newline at end of file
+fn main() { }