mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-14 01:25:54 +00:00
39 lines
641 B
Rust
39 lines
641 B
Rust
|
|
/// 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;
|
|
|
|
// 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
|
|
}
|
|
|
|
struct Baz {
|
|
// Comment A
|
|
a: A,
|
|
// Comment B
|
|
b: B,
|
|
// Comment C
|
|
c: C,
|
|
}
|