]> 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 33472a7f83c384f8b4ecf6ae4947ec3081146832..083f5143e6e4d75c662975f2f847b63d83ea41bb 100644 (file)
@@ -1,15 +1,5 @@
-// Copyright 2014-2018 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution.
-//
-// 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.
-
-#![feature(non_ascii_idents)]
-#![warn(clippy::all, clippy::pub_enum_variant_names)]
-#![allow(non_camel_case_types)]
+#![warn(clippy::enum_variant_names)]
+#![allow(non_camel_case_types, clippy::upper_case_acronyms)]
 
 enum FakeCallType {
     CALL,
@@ -106,8 +96,8 @@ pub enum PubSeall {
     WithOut,
 }
 
-#[allow(clippy::pub_enum_variant_names)]
-mod allowed {
+#[allow(clippy::enum_variant_names)]
+pub mod allowed {
     pub enum PubAllowed {
         SomeThis,
         SomeThat,
@@ -129,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() {}