]> git.lizzy.rs Git - rust.git/blobdiff - tests/target/enum.rs
Tidy up and pass tests
[rust.git] / tests / target / enum.rs
index 2440d042d24f368c9b9f0c754ebb9ce5fe3e917e..de88f610b6a68cddc0916ca012d2e748a4de026a 100644 (file)
@@ -24,7 +24,8 @@ enum EmtpyWithComment {
 // C-style enum
 enum Bar {
     A = 1,
-    #[someAttr(test)] B = 2, // comment
+    #[someAttr(test)]
+    B = 2, // comment
     C,
 }
 
@@ -42,9 +43,12 @@ enum StructLikeVariants {
     StructLike {
         x: i32, // Test comment
         // Pre-comment
-        #[Attr50] y: SomeType, // Aanother Comment
+        #[Attr50]
+        y: SomeType, // Aanother Comment
+    },
+    SL {
+        a: A,
     },
-    SL { a: A },
 }
 
 enum X {
@@ -56,7 +60,7 @@ enum X {
 }
 
 pub enum EnumWithAttributes {
-    // This is a pre comment
+    //This is a pre comment
     // AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
     TupleVar(usize, usize, usize), /* AAAA AAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAA
                                     * AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA */
@@ -65,7 +69,10 @@ pub enum EnumWithAttributes {
     SkippedItem(String,String,), // Post-comment
     #[another_attr]
     #[attr2]
-    ItemStruct { x: usize, y: usize }, /* Comment AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA */
+    ItemStruct {
+        x: usize,
+        y: usize,
+    }, /* Comment AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA */
     // And another
     ForcedPreflight, /* AAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
                       * AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA */
@@ -90,7 +97,6 @@ pub enum GenericEnum<I, T>
     Right { list: I, root: T }, // Post Comment
 }
 
-
 enum EmtpyWithComment {
     // Some comment
 }
@@ -139,8 +145,7 @@ 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
+    /// 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>>),
@@ -179,3 +184,72 @@ pub enum ForegroundColor {
     CYAN =
         (winapi::FOREGROUND_INTENSITY | winapi::FOREGROUND_GREEN | winapi::FOREGROUND_BLUE) as u16,
 }
+
+// #2098
+pub enum E<'a> {
+    V(<std::slice::Iter<'a, Xxxxxxxxxxxxxx> as Iterator>::Item),
+}
+
+// #1809
+enum State {
+    TryRecv {
+        pos: usize,
+        lap: u8,
+        closed_count: usize,
+    },
+    Subscribe {
+        pos: usize,
+    },
+    IsReady {
+        pos: usize,
+        ready: bool,
+    },
+    Unsubscribe {
+        pos: usize,
+        lap: u8,
+        id_woken: usize,
+    },
+    FinalTryRecv {
+        pos: usize,
+        id_woken: usize,
+    },
+    TimedOut,
+    Disconnected,
+}
+
+// #2190
+#[derive(Debug, Fail)]
+enum AnError {
+    #[fail(display = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")]
+    UnexpectedSingleToken { token: syn::Token },
+}
+
+// #2193
+enum WidthOf101 {
+    #[fail(display = ".....................................................")]
+    Io(::std::io::Error),
+    #[fail(display = ".....................................................")]
+    Ioo(::std::io::Error),
+    Xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx(::std::io::Error),
+    Xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx(
+        ::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 = "Could not find {}: Found: {}, expected: {:?}", 0, 1, 2)]
+    ResolveError(&'static str, String, Option<String>),
+}