2015-11-09 19:03:01 +00:00
|
|
|
// rustfmt-wrap_comments: true
|
2015-06-23 13:58:58 +00: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,
|
|
|
|
pub i: TypeForPublicField
|
|
|
|
}
|
|
|
|
|
|
|
|
struct Bar;
|
|
|
|
|
|
|
|
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,);
|
|
|
|
|
|
|
|
// With a where clause and generics.
|
|
|
|
pub struct Foo<'a, Y: Baz>
|
|
|
|
where X: Whatever
|
|
|
|
{
|
|
|
|
f: SomeType, // Comment beside a field
|
|
|
|
}
|
|
|
|
|
|
|
|
struct Baz {
|
2015-09-02 02:11:19 +00:00
|
|
|
|
2015-06-23 13:58:58 +00:00
|
|
|
a: A, // Comment A
|
|
|
|
b: B, // Comment B
|
|
|
|
c: C, // Comment C
|
2015-09-02 02:11:19 +00: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-06-23 13:58:58 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
struct Baz
|
|
|
|
{
|
|
|
|
// Comment A
|
|
|
|
a: A,
|
2015-09-02 02:11:19 +00:00
|
|
|
|
2015-06-23 13:58:58 +00:00
|
|
|
// Comment B
|
|
|
|
b: B,
|
|
|
|
// Comment C
|
|
|
|
c: C,}
|
|
|
|
|
|
|
|
// Will this be a one-liner?
|
|
|
|
struct Tuple(
|
|
|
|
A, //Comment
|
|
|
|
B
|
|
|
|
);
|
2015-08-21 14:28:32 +00: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 14:53:44 +00:00
|
|
|
|
|
|
|
struct Palette { /// A map of indizes in the palette to a count of pixels in approximately that color
|
|
|
|
foo: i32}
|
2015-10-07 23:23:07 +00:00
|
|
|
|
|
|
|
// Splitting a single line comment into a block previously had a misalignment
|
|
|
|
// when the field had attributes
|
|
|
|
struct FieldsWithAttributes {
|
|
|
|
// Pre Comment
|
|
|
|
#[rustfmt_skip] pub host:String, // Post comment BBBBBBBBBBBBBB BBBBBBBBBBBBBBBB BBBBBBBBBBBBBBBB BBBBBBBBBBBBBBBBB BBBBBBBBBBB
|
|
|
|
//Another pre comment
|
|
|
|
#[attr1]
|
|
|
|
#[attr2] pub id: usize // CCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCC CCCCCCCCCCCC
|
|
|
|
}
|
2015-10-18 22:25:38 +00:00
|
|
|
|
|
|
|
struct Deep {
|
|
|
|
deeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeep: node::Handle<IdRef<'id, Node<K, V>>,
|
|
|
|
Type,
|
|
|
|
NodeType>,
|
|
|
|
}
|
2015-11-09 06:00:04 +00:00
|
|
|
|
|
|
|
struct Foo<T>(T);
|
|
|
|
struct Foo<T>(T) where T: Copy, T: Eq;
|
|
|
|
struct Foo<T>(TTTTTTTTTTTTTTTTT, UUUUUUUUUUUUUUUUUUUUUUUU, TTTTTTTTTTTTTTTTTTT, UUUUUUUUUUUUUUUUUUU);
|
|
|
|
struct Foo<T>(TTTTTTTTTTTTTTTTTT, UUUUUUUUUUUUUUUUUUUUUUUU, TTTTTTTTTTTTTTTTTTT) where T: PartialEq;
|
|
|
|
struct Foo<T>(TTTTTTTTTTTTTTTTT, UUUUUUUUUUUUUUUUUUUUUUUU, TTTTTTTTTTTTTTTTTTTTT) where T: PartialEq;
|
|
|
|
struct Foo<T>(TTTTTTTTTTTTTTTTT, UUUUUUUUUUUUUUUUUUUUUUUU, TTTTTTTTTTTTTTTTTTT, UUUUUUUUUUUUUUUUUUU) where T: PartialEq;
|
|
|
|
struct Foo<T>(TTTTTTTTTTTTTTTTT, // Foo
|
|
|
|
UUUUUUUUUUUUUUUUUUUUUUUU /* Bar */,
|
|
|
|
// Baz
|
|
|
|
TTTTTTTTTTTTTTTTTTT,
|
|
|
|
// Qux (FIXME #572 - doc comment)
|
|
|
|
UUUUUUUUUUUUUUUUUUU);
|
2015-11-13 13:31:20 +00:00
|
|
|
|
|
|
|
mod m {
|
|
|
|
struct X<T> where T: Sized {
|
|
|
|
a: T,
|
|
|
|
}
|
|
|
|
}
|
2015-11-22 21:55:57 +00:00
|
|
|
|
|
|
|
struct Foo<T>(TTTTTTTTTTTTTTTTTTT,
|
|
|
|
/// Qux
|
|
|
|
UUUUUUUUUUUUUUUUUUU);
|