2015-05-25 01:03:26 +02:00
|
|
|
|
|
|
|
/// A Doc comment
|
|
|
|
#[AnAttribute]
|
|
|
|
pub struct Foo {
|
|
|
|
#[rustfmt_skip]
|
|
|
|
f : SomeType, // Comment beside a field
|
|
|
|
f: SomeType, // Comment beside a field
|
|
|
|
// Comment on a field
|
|
|
|
#[AnAttribute]
|
|
|
|
g: SomeOtherType,
|
|
|
|
/// A doc comment on a field
|
|
|
|
h: AThirdType,
|
2015-06-10 23:17:59 +02:00
|
|
|
pub i: TypeForPublicField,
|
2015-05-25 01:03:26 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
struct Bar;
|
|
|
|
|
2015-06-23 15:58:58 +02:00
|
|
|
struct NewType(Type, OtherType);
|
|
|
|
|
|
|
|
struct NewInt<T: Copy>(pub i32, SomeType /* inline comment */, T /* sup */);
|
|
|
|
|
|
|
|
struct Qux<'a,
|
|
|
|
N: Clone + 'a,
|
|
|
|
E: Clone + 'a,
|
|
|
|
G: Labeller<'a, N, E> + GraphWalk<'a, N, E>,
|
|
|
|
W: Write + Copy>
|
|
|
|
(
|
|
|
|
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA, // Comment
|
|
|
|
BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB,
|
|
|
|
#[AnAttr]
|
|
|
|
// Comment
|
|
|
|
/// Testdoc
|
|
|
|
G,
|
|
|
|
pub W,
|
|
|
|
);
|
|
|
|
|
|
|
|
struct Tuple(
|
|
|
|
// Comment 1
|
|
|
|
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA,
|
|
|
|
// Comment 2
|
|
|
|
BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB,
|
|
|
|
);
|
|
|
|
|
2015-05-25 01:03:26 +02:00
|
|
|
// With a where clause and generics.
|
|
|
|
pub struct Foo<'a, Y: Baz>
|
|
|
|
where X: Whatever
|
|
|
|
{
|
|
|
|
f: SomeType, // Comment beside a field
|
|
|
|
}
|
|
|
|
|
|
|
|
struct Baz {
|
|
|
|
a: A, // Comment A
|
|
|
|
b: B, // Comment B
|
|
|
|
c: C, // Comment C
|
|
|
|
}
|
|
|
|
|
2015-09-02 04:11:19 +02:00
|
|
|
struct Baz {
|
|
|
|
a: A, // Comment A
|
|
|
|
|
|
|
|
b: B, // Comment B
|
|
|
|
|
|
|
|
c: C, // Comment C
|
|
|
|
}
|
|
|
|
|
|
|
|
struct Baz {
|
|
|
|
a: A,
|
|
|
|
|
|
|
|
b: B,
|
|
|
|
c: C,
|
|
|
|
|
|
|
|
d: D,
|
|
|
|
}
|
|
|
|
|
2015-05-25 01:03:26 +02:00
|
|
|
struct Baz {
|
|
|
|
// Comment A
|
|
|
|
a: A,
|
2015-09-02 04:11:19 +02:00
|
|
|
|
2015-05-25 01:03:26 +02:00
|
|
|
// Comment B
|
|
|
|
b: B,
|
|
|
|
// Comment C
|
|
|
|
c: C,
|
|
|
|
}
|
2015-06-23 15:58:58 +02:00
|
|
|
|
|
|
|
// Will this be a one-liner?
|
|
|
|
struct Tuple(A /* Comment */, B);
|
2015-08-21 16:28:32 +02:00
|
|
|
|
|
|
|
pub struct State<F: FnMut() -> time::Timespec> {
|
|
|
|
now: F,
|
|
|
|
}
|
|
|
|
|
|
|
|
pub struct State<F: FnMut() -> ()> {
|
|
|
|
now: F,
|
|
|
|
}
|
|
|
|
|
|
|
|
pub struct State<F: FnMut()> {
|
|
|
|
now: F,
|
|
|
|
}
|
2015-09-25 16:53:44 +02:00
|
|
|
|
|
|
|
struct Palette {
|
|
|
|
/// A map of indizes in the palette to a count of pixels in approximately that color
|
|
|
|
foo: i32,
|
|
|
|
}
|