]> git.lizzy.rs Git - rust.git/blobdiff - tests/target/enum.rs
Honor `#[rustfmt::skip::attributes(derive)]` attribute
[rust.git] / tests / target / enum.rs
index 78b0fd1b69d03e92403423073cbe825d41bfd120..9a25126b44ecb49888e74c358e95382a822c9528 100644 (file)
@@ -1,5 +1,4 @@
 // rustfmt-wrap_comments: true
-// rustfmt-error_on_line_overflow: false
 // Enums test
 
 #[atrr]
@@ -24,7 +23,8 @@ enum EmtpyWithComment {
 // C-style enum
 enum Bar {
     A = 1,
-    #[someAttr(test)] B = 2, // comment
+    #[someAttr(test)]
+    B = 2, // comment
     C,
 }
 
@@ -42,7 +42,8 @@ enum StructLikeVariants {
     StructLike {
         x: i32, // Test comment
         // Pre-comment
-        #[Attr50] y: SomeType, // Aanother Comment
+        #[Attr50]
+        y: SomeType, // Aanother Comment
     },
     SL {
         a: A,
@@ -58,12 +59,12 @@ enum X {
 }
 
 pub enum EnumWithAttributes {
-    // This is a pre comment
+    //This is a pre comment
     // AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
     TupleVar(usize, usize, usize), /* AAAA AAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAA
                                     * AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA */
     // Pre Comment
-    #[rustfmt_skip]
+    #[rustfmt::skip]
     SkippedItem(String,String,), // Post-comment
     #[another_attr]
     #[attr2]
@@ -95,7 +96,6 @@ pub enum GenericEnum<I, T>
     Right { list: I, root: T }, // Post Comment
 }
 
-
 enum EmtpyWithComment {
     // Some comment
 }
@@ -144,8 +144,9 @@ pub enum Bencoding<'i> {
     Str(&'i [u8]),
     Int(i64),
     List(Vec<Bencoding<'i>>),
-    /// A bencoded dict value. The first element the slice of bytes in the source that the dict is
-    /// composed of. The second is the dict, decoded into an ordered map.
+    /// A bencoded dict value. The first element the slice of bytes in the
+    /// source that the dict is composed of. The second is the dict, decoded
+    /// into an ordered map.
     // TODO make Dict "structlike" AKA name the two values.
     Dict(&'i [u8], BTreeMap<&'i [u8], Bencoding<'i>>),
 }
@@ -154,8 +155,10 @@ pub enum Bencoding<'i> {
 pub enum CoreResourceMsg {
     SetCookieForUrl(
         ServoUrl,
-        #[serde(deserialize_with = "::hyper_serde::deserialize",
-                serialize_with = "::hyper_serde::serialize")]
+        #[serde(
+            deserialize_with = "::hyper_serde::deserialize",
+            serialize_with = "::hyper_serde::serialize"
+        )]
         Cookie,
         CookieSource,
     ),
@@ -219,13 +222,16 @@ enum State {
 // #2190
 #[derive(Debug, Fail)]
 enum AnError {
-    #[fail(display = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")]
+    #[fail(
+        display = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
+    )]
     UnexpectedSingleToken { token: syn::Token },
 }
 
 // #2193
 enum WidthOf101 {
-    #[fail(display = ".....................................................")] Io(::std::io::Error),
+    #[fail(display = ".....................................................")]
+    Io(::std::io::Error),
     #[fail(display = ".....................................................")]
     Ioo(::std::io::Error),
     Xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx(::std::io::Error),
@@ -233,3 +239,51 @@ enum WidthOf101 {
         ::std::io::Error,
     ),
 }
+
+// #2389
+pub enum QlError {
+    #[fail(display = "Parsing error: {}", 0)]
+    LexError(parser::lexer::LexError),
+    #[fail(display = "Parsing error: {:?}", 0)]
+    ParseError(parser::ParseError),
+    #[fail(display = "Validation error: {:?}", 0)]
+    ValidationError(Vec<validation::Error>),
+    #[fail(display = "Execution error: {}", 0)]
+    ExecutionError(String),
+    // (from, to)
+    #[fail(display = "Translation error: from {} to {}", 0, 1)]
+    TranslationError(String, String),
+    // (kind, input, expected)
+    #[fail(
+        display = "aaaaaaaaaaaaCould not find {}: Found: {}, expected: {:?}",
+        0, 1, 2
+    )]
+    ResolveError(&'static str, String, Option<String>),
+}
+
+// #2594
+enum Foo {}
+enum Bar {}
+
+// #3562
+enum PublishedFileVisibility {
+    Public =
+        sys::ERemoteStoragePublishedFileVisibility_k_ERemoteStoragePublishedFileVisibilityPublic,
+    FriendsOnly = sys::ERemoteStoragePublishedFileVisibility_k_ERemoteStoragePublishedFileVisibilityFriendsOnly,
+    Private =
+        sys::ERemoteStoragePublishedFileVisibility_k_ERemoteStoragePublishedFileVisibilityPrivate,
+}
+
+// #3771
+//#![feature(arbitrary_enum_discriminant)]
+#[repr(u32)]
+pub enum E {
+    A {
+        a: u32,
+    } = 0x100,
+    B {
+        field1: u32,
+        field2: u8,
+        field3: m::M,
+    } = 0x300, // comment
+}