2015-11-09 13:03:01 -06:00
|
|
|
// rustfmt-wrap_comments: true
|
2017-02-19 12:57:02 -06:00
|
|
|
// rustfmt-error_on_line_overflow: false
|
2015-05-29 05:41:26 -05:00
|
|
|
// Enums test
|
|
|
|
|
|
|
|
#[atrr]
|
|
|
|
pub enum Test {
|
|
|
|
A,
|
2015-06-23 08:58:58 -05:00
|
|
|
B(u32, A /* comment */, SomeType),
|
2015-05-29 05:41:26 -05:00
|
|
|
/// Doc comment
|
|
|
|
C,
|
|
|
|
}
|
|
|
|
|
|
|
|
pub enum Foo<'a, Y: Baz>
|
2017-06-11 23:01:41 -05:00
|
|
|
where
|
|
|
|
X: Whatever,
|
2015-05-29 05:41:26 -05:00
|
|
|
{
|
|
|
|
A,
|
|
|
|
}
|
|
|
|
|
|
|
|
enum EmtpyWithComment {
|
|
|
|
// Some comment
|
|
|
|
}
|
|
|
|
|
|
|
|
// C-style enum
|
|
|
|
enum Bar {
|
|
|
|
A = 1,
|
|
|
|
#[someAttr(test)]
|
|
|
|
B = 2, // comment
|
|
|
|
C,
|
|
|
|
}
|
|
|
|
|
|
|
|
enum LongVariants {
|
2017-06-11 23:01:41 -05:00
|
|
|
First(
|
|
|
|
LOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOONG, // comment
|
|
|
|
VARIANT
|
|
|
|
),
|
2015-05-29 05:41:26 -05:00
|
|
|
// This is the second variant
|
|
|
|
Second,
|
|
|
|
}
|
2015-06-23 08:58:58 -05:00
|
|
|
|
|
|
|
enum StructLikeVariants {
|
|
|
|
Normal(u32, String),
|
|
|
|
StructLike {
|
|
|
|
x: i32, // Test comment
|
|
|
|
// Pre-comment
|
|
|
|
#[Attr50]
|
|
|
|
y: SomeType, // Aanother Comment
|
2015-07-01 13:49:45 -05:00
|
|
|
},
|
2016-05-18 15:38:49 -05:00
|
|
|
SL { a: A },
|
2015-06-23 08:58:58 -05:00
|
|
|
}
|
2015-09-27 10:23:37 -05:00
|
|
|
|
|
|
|
enum X {
|
2017-06-11 23:01:41 -05:00
|
|
|
CreateWebGLPaintTask(
|
|
|
|
Size2D<i32>,
|
|
|
|
GLContextAttributes,
|
|
|
|
IpcSender<Result<(IpcSender<CanvasMsg>, usize), String>>
|
|
|
|
), // This is a post comment
|
2015-10-07 18:23:07 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
pub enum EnumWithAttributes {
|
|
|
|
// This is a pre comment
|
|
|
|
// AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
|
|
|
TupleVar(usize, usize, usize), /* AAAA AAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAA
|
|
|
|
* AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA */
|
|
|
|
// Pre Comment
|
|
|
|
#[rustfmt_skip]
|
|
|
|
SkippedItem(String,String,), // Post-comment
|
|
|
|
#[another_attr]
|
|
|
|
#[attr2]
|
2016-05-18 15:38:49 -05:00
|
|
|
ItemStruct { x: usize, y: usize }, /* Comment AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA */
|
2015-10-07 18:23:07 -05:00
|
|
|
// And another
|
|
|
|
ForcedPreflight, /* AAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
|
|
|
* AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA */
|
|
|
|
}
|
|
|
|
|
|
|
|
pub enum SingleTuple {
|
|
|
|
// Pre Comment AAAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
|
|
|
// AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
2017-01-05 21:35:28 -06:00
|
|
|
Match(usize, usize, String), /* Post-comment AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA */
|
2015-10-07 18:23:07 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
pub enum SingleStruct {
|
2016-05-18 15:38:49 -05:00
|
|
|
Match { name: String, loc: usize }, // Post-comment
|
2015-10-07 18:23:07 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
pub enum GenericEnum<I, T>
|
2017-06-11 23:01:41 -05:00
|
|
|
where
|
|
|
|
I: Iterator<Item = T>,
|
2015-10-07 18:23:07 -05:00
|
|
|
{
|
|
|
|
// Pre Comment
|
2016-05-18 15:38:49 -05:00
|
|
|
Left { list: I, root: T }, // Post-comment
|
|
|
|
Right { list: I, root: T }, // Post Comment
|
2015-10-07 18:23:07 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
enum EmtpyWithComment {
|
|
|
|
// Some comment
|
|
|
|
}
|
|
|
|
|
|
|
|
enum TestFormatFails {
|
|
|
|
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
|
|
|
}
|
|
|
|
|
|
|
|
fn nested_enum_test() {
|
|
|
|
if true {
|
|
|
|
enum TestEnum {
|
2017-06-11 23:01:41 -05:00
|
|
|
One(
|
2015-10-07 18:23:07 -05:00
|
|
|
usize,
|
|
|
|
usize,
|
|
|
|
usize,
|
|
|
|
usize,
|
|
|
|
usize,
|
|
|
|
usize,
|
|
|
|
usize,
|
|
|
|
usize,
|
|
|
|
usize,
|
|
|
|
usize,
|
|
|
|
usize,
|
|
|
|
usize,
|
|
|
|
usize,
|
|
|
|
usize,
|
2017-06-11 23:01:41 -05:00
|
|
|
usize,
|
|
|
|
usize
|
|
|
|
), /* AAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAA
|
|
|
|
* AAAAAAAAAAAAAAAAAAAAAA */
|
2015-10-07 18:23:07 -05:00
|
|
|
Two, /* AAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
|
|
|
* AAAAAAAAAAAAAAAAAA */
|
|
|
|
}
|
|
|
|
enum TestNestedFormatFail {
|
|
|
|
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
|
|
|
|
}
|
|
|
|
}
|
2015-09-27 10:23:37 -05:00
|
|
|
}
|
2015-10-18 17:25:38 -05:00
|
|
|
|
|
|
|
pub struct EmtpyWithComment {
|
|
|
|
// FIXME: Implement this struct
|
|
|
|
}
|
2017-06-04 09:27:21 -05:00
|
|
|
|
|
|
|
// #1115
|
|
|
|
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.
|
|
|
|
// TODO make Dict "structlike" AKA name the two values.
|
|
|
|
Dict(&'i [u8], BTreeMap<&'i [u8], Bencoding<'i>>),
|
|
|
|
}
|
2017-06-05 09:21:39 -05:00
|
|
|
|
|
|
|
// #1261
|
|
|
|
pub enum CoreResourceMsg {
|
2017-06-11 23:01:41 -05:00
|
|
|
SetCookieForUrl(
|
|
|
|
ServoUrl,
|
|
|
|
#[serde(deserialize_with = "::hyper_serde::deserialize",
|
|
|
|
serialize_with = "::hyper_serde::serialize")]
|
|
|
|
Cookie,
|
|
|
|
CookieSource
|
|
|
|
),
|
2017-06-05 09:21:39 -05:00
|
|
|
}
|