1 // rustfmt-normalize_comments: true
2 // rustfmt-wrap_comments: true
8 f : SomeType, // Comment beside a field
9 f: SomeType, // Comment beside a field
13 /// A doc comment on a field
15 pub i: TypeForPublicField,
19 struct S<T /* comment */> {
26 // This will NOT get deleted!
32 // `x` is an important number.
33 #[allow(unused)] // TODO: use
38 #[allow(missing_docs)]
39 pub struct Writebatch<K: Key> {
40 #[allow(dead_code)] // only used for holding the internal pointer
41 writebatch: RawWritebatch,
42 marker: PhantomData<K>,
47 struct NewType(Type, OtherType);
49 struct NewInt<T: Copy>(
51 SomeType, // inline comment
59 G: Labeller<'a, N, E> + GraphWalk<'a, N, E>,
62 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA, // Comment
63 BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB,
73 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA,
75 BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB,
78 // With a where clause and generics.
79 pub struct Foo<'a, Y: Baz>
83 f: SomeType, // Comment beside a field
119 // Will this be a one-liner?
125 pub struct State<F: FnMut() -> time::Timespec> {
129 pub struct State<F: FnMut() -> ()> {
133 pub struct State<F: FnMut()> {
138 /// A map of indices in the palette to a count of pixels in approximately
143 // Splitting a single line comment into a block previously had a misalignment
144 // when the field had attributes
145 struct FieldsWithAttributes {
147 #[rustfmt::skip] pub host:String, /* Post comment BBBBBBBBBBBBBB BBBBBBBBBBBBBBBB
148 * BBBBBBBBBBBBBBBB BBBBBBBBBBBBBBBBB BBBBBBBBBBB */
149 // Another pre comment
152 pub id: usize, /* CCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCC
153 * CCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCC CCCCCCCCCCCC */
157 deeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeep:
158 node::Handle<IdRef<'id, Node<K, V>>, Type, NodeType>,
168 UUUUUUUUUUUUUUUUUUUUUUUU,
174 UUUUUUUUUUUUUUUUUUUUUUUU,
181 UUUUUUUUUUUUUUUUUUUUUUUU,
182 TTTTTTTTTTTTTTTTTTTTT,
188 UUUUUUUUUUUUUUUUUUUUUUUU,
195 TTTTTTTTTTTTTTTTT, // Foo
196 UUUUUUUUUUUUUUUUUUUUUUUU, // Bar
199 // Qux (FIXME #572 - doc comment)
219 pub ptr: *const libc::c_void,
220 pub trace: fn(obj: *const libc::c_void, tracer: *mut JSTracer),
240 the_quick_brown_fox_jumps_over_the_lazy_dog:
241 AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA,
245 deeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeep:
246 node::Handle<IdRef<'id, Node<Key, Value>>, Type, NodeType>,
249 struct Foo<C = ()>(String);
253 convex_shape.set_point(0, &Vector2f { x: 400.0, y: 100.0 });
254 convex_shape.set_point(1, &Vector2f { x: 500.0, y: 70.0 });
255 convex_shape.set_point(2, &Vector2f { x: 450.0, y: 100.0 });
256 convex_shape.set_point(3, &Vector2f { x: 580.0, y: 150.0 });
259 // Vertical alignment
266 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx: u32, // 1
268 zzz: u32, // comment3
270 aaaaaa: u32, // comment4
276 aaaaaaa: u32, /* multi
282 do_not_push_this_comment1: u32, // comment1
283 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx: u32, // 2
284 please_do_not_push_this_comment3: u32, // comment3
286 do_not_push_this_comment1: u32, // comment1
288 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx: u32, // 2
289 please_do_not_push_this_comment3: u32, // comment3
291 do_not_push_this_comment1: u32, // comment1
292 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx: u32, // 2
294 please_do_not_push_this_comment3: u32, // comment3
297 // structs with long identifier
298 struct Loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong
300 struct Looooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong
302 struct Loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong
304 struct Loooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooong
309 // structs with visibility, do not duplicate visibility (#2110).
310 pub(self) struct Foo {}
311 pub(super) struct Foo {}
312 pub(crate) struct Foo {}
313 pub(self) struct Foo();
314 pub(super) struct Foo();
315 pub(crate) struct Foo();
318 pub struct ReadinessCheckRegistry(
319 Mutex<HashMap<Arc<String>, Box<Fn() -> ReadinessCheck + Sync + Send>>>,
322 // #2144 unit struct with generics
323 struct MyBox<T: ?Sized>;
333 pub join: Vec<String>,
342 struct Parens((i32, i32))