|
2 | 2 | // rustfmt-normalize_doc_attributes: true
|
3 | 3 |
|
4 | 4 | // Only doc = "" attributes should be normalized
|
5 |
| -#![doc = "Example doc attribute comment"] |
| 5 | +#![doc = " Example doc attribute comment"] |
| 6 | +#![doc = " Example doc attribute comment with 10 leading spaces"] |
6 | 7 | #![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
|
7 | 8 | html_favicon_url = "https://doc.rust-lang.org/favicon.ico",
|
8 | 9 | html_root_url = "https://doc.rust-lang.org/nightly/",
|
9 | 10 | html_playground_url = "https://play.rust-lang.org/", test(attr(deny(warnings))))]
|
10 | 11 |
|
11 | 12 |
|
12 | 13 | // Long `#[doc = "..."]`
|
13 |
| -struct A { #[doc = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"] b: i32 } |
| 14 | +struct A { #[doc = " xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"] b: i32 } |
14 | 15 |
|
15 | 16 |
|
16 |
| -#[doc = "The `nodes` and `edges` method each return instantiations of `Cow<[T]>` to leave implementers the freedom to create entirely new vectors or to pass back slices into internally owned vectors."] |
| 17 | +#[doc = " The `nodes` and `edges` method each return instantiations of `Cow<[T]>` to leave implementers the freedom to create entirely new vectors or to pass back slices into internally owned vectors."] |
17 | 18 | struct B { b: i32 }
|
18 | 19 |
|
19 | 20 |
|
20 |
| -#[doc = "Level 1 comment"] |
| 21 | +#[doc = " Level 1 comment"] |
21 | 22 | mod tests {
|
22 |
| - #[doc = "Level 2 comment"] |
| 23 | + #[doc = " Level 2 comment"] |
23 | 24 | impl A {
|
24 |
| - #[doc = "Level 3 comment"] |
| 25 | + #[doc = " Level 3 comment"] |
25 | 26 | fn f() {
|
26 |
| - #[doc = "Level 4 comment"] |
| 27 | + #[doc = " Level 4 comment"] |
27 | 28 | fn g() {
|
28 | 29 | }
|
29 | 30 | }
|
30 | 31 | }
|
31 | 32 | }
|
32 | 33 |
|
33 | 34 | struct C {
|
34 |
| - #[doc = "item doc attrib comment"] |
| 35 | + #[doc = " item doc attrib comment"] |
35 | 36 | // regular item comment
|
36 | 37 | b: i32,
|
37 | 38 |
|
38 | 39 | // regular item comment
|
39 |
| - #[doc = "item doc attrib comment"] |
| 40 | + #[doc = " item doc attrib comment"] |
40 | 41 | c: i32,
|
41 | 42 | }
|
42 | 43 |
|
@@ -89,3 +90,30 @@ pub struct Params {
|
89 | 90 | all(target_arch = "wasm32", feature = "wasm-bindgen"),
|
90 | 91 | ))))]
|
91 | 92 | type Os = NoSource;
|
| 93 | + |
| 94 | +// use cases from bindgen needing precise control over leading spaces |
| 95 | +#[doc = " <div rustbindgen accessor></div>"] |
| 96 | +#[repr(C)] |
| 97 | +#[derive(Debug, Default, Copy, Clone)] |
| 98 | +pub struct ContradictAccessors { |
| 99 | + #[doc = "<foo>no leading spaces here</foo>"] |
| 100 | + pub mBothAccessors: ::std::os::raw::c_int, |
| 101 | + #[doc = " <div rustbindgen accessor=\"false\"></div>"] |
| 102 | + pub mNoAccessors: ::std::os::raw::c_int, |
| 103 | + #[doc = " <div rustbindgen accessor=\"unsafe\"></div>"] |
| 104 | + pub mUnsafeAccessors: ::std::os::raw::c_int, |
| 105 | + #[doc = " <div rustbindgen accessor=\"immutable\"></div>"] |
| 106 | + pub mImmutableAccessor: ::std::os::raw::c_int, |
| 107 | +} |
| 108 | + |
| 109 | +#[doc = " \\brief MPI structure"] |
| 110 | +#[repr(C)] |
| 111 | +#[derive(Debug, Copy, Clone)] |
| 112 | +pub struct mbedtls_mpi { |
| 113 | + #[doc = "< integer sign"] |
| 114 | + pub s: ::std::os::raw::c_int, |
| 115 | + #[doc = "< total # of limbs"] |
| 116 | + pub n: ::std::os::raw::c_ulong, |
| 117 | + #[doc = "< pointer to limbs"] |
| 118 | + pub p: *mut mbedtls_mpi_uint, |
| 119 | +} |
0 commit comments