]> git.lizzy.rs Git - rust.git/blobdiff - tests/ui/enum_variants.rs
Ignore associated items in trait *implementations* when considering type complexity
[rust.git] / tests / ui / enum_variants.rs
index 222c76c25b76344361b8b9a6e1a5d0afbf559b09..083f5143e6e4d75c662975f2f847b63d83ea41bb 100644 (file)
@@ -1,13 +1,14 @@
-#![feature(non_ascii_idents)]
-
-#![warn(clippy, pub_enum_variant_names)]
+#![warn(clippy::enum_variant_names)]
+#![allow(non_camel_case_types, clippy::upper_case_acronyms)]
 
 enum FakeCallType {
-    CALL, CREATE
+    CALL,
+    CREATE,
 }
 
 enum FakeCallType2 {
-    CALL, CREATELL
+    CALL,
+    CREATELL,
 }
 
 enum Foo {
@@ -37,7 +38,8 @@ enum BadCallType {
     CallTypeDestroy,
 }
 
-enum TwoCallType { // no error
+enum TwoCallType {
+    // no error
     CallTypeCall,
     CallTypeCreate,
 }
@@ -48,7 +50,8 @@ enum Consts {
     ConstantLie,
 }
 
-enum Two { // no error here
+enum Two {
+    // no error here
     ConstantInt,
     ConstantInfer,
 }
@@ -93,8 +96,8 @@ pub enum PubSeall {
     WithOut,
 }
 
-#[allow(pub_enum_variant_names)]
-mod allowed {
+#[allow(clippy::enum_variant_names)]
+pub mod allowed {
     pub enum PubAllowed {
         SomeThis,
         SomeThat,
@@ -116,4 +119,30 @@ enum N {
     Float,
 }
 
+// should not lint
+enum Peek {
+    Peek1,
+    Peek2,
+    Peek3,
+}
+
+// should not lint
+pub enum NetworkLayer {
+    Layer2,
+    Layer3,
+}
+
+// should lint suggesting `IData`, not only `Data` (see #4639)
+enum IDataRequest {
+    PutIData(String),
+    GetIData(String),
+    DeleteUnpubIData(String),
+}
+
+enum HIDataRequest {
+    PutHIData(String),
+    GetHIData(String),
+    DeleteUnpubHIData(String),
+}
+
 fn main() {}