1 // rustfmt-wrap_comments: true
2 // Test attributes and doc comments are preserved.
4 html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
5 html_favicon_url = "https://doc.rust-lang.org/favicon.ico",
6 html_root_url = "https://doc.rust-lang.org/nightly/",
7 html_playground_url = "https://play.rust-lang.org/",
8 test(attr(deny(warnings)))
19 // Comment on attribute
36 #[doc = "an attribute that shouldn't be normalized to a doc comment"]
37 fn foo(&mut self) -> isize {}
58 // Another comment that needs rewrite because it's tooooooooooooooooooooooooooooooo
63 // We want spaces around `=`
64 #[cfg(feature = "nightly")]
65 fn f5(self) -> Monkey {}
70 #[derive(Clone, PartialEq, Debug, Deserialize, Serialize)]
76 /// Default path (*nix)
79 not(target_os = "macos"),
80 not(target_os = "ios"),
81 not(target_os = "android")
84 #[cfg(target_os = "freertos")]
86 'a' | 'A' => GpioPort {
89 'b' | 'B' => GpioPort {
95 #[cfg_attr(not(target_os = "freertos"), allow(unused_variables))]
101 #[should_panic(expected = "(")]
102 #[should_panic(expected = /* ( */ "(")]
103 #[should_panic(/* ((((( */expected /* ((((( */= /* ((((( */ "("/* ((((( */)]
106 (((((((((()(((((((( */
114 #[allow(unreachable_code)] // https://github.com/rust-lang/rust/issues/43336
117 #[allow(unreachable_code)]
118 // https://github.com/rust-lang/rust/issues/43336
122 // Formatting inner attributes
123 fn inner_attributes() {
124 #![this_is_an_inner_attribute(foo)]
129 impl InnerAttributes() {
130 #![this_is_an_inner_attribute(foo)]
135 mod InnerAttributes {
136 #![this_is_an_inner_attribute(foo)]
139 fn attributes_on_statements() {
163 Add, Sub, Mul, Div, Clone, Copy, Eq, PartialEq, Ord, PartialOrd, Debug, Hash, Serialize, Mul,
184 pub struct HP(pub u8);
186 // Long `#[doc = "..."]`
188 #[doc = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"]
194 feature = "this_line_is_101_characters_long_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
200 #[clippy::bar(a, b, c)]
204 #[derive(Debug, StructOpt)]
205 #[structopt(about = "Display information about the character on FF Logs")]
207 #[structopt(help = "The server the character is on")]
209 #[structopt(help = "The character's first name")]
211 #[structopt(help = "The character's last name")]
216 help = "The job to look at",
228 target_os = "android",
229 target_os = "netbsd",
230 target_os = "dragonfly",
232 target_os = "emscripten",
233 target_os = "solaris",
234 target_os = "cloudabi",
237 target_os = "freebsd",
238 target_os = "openbsd",
240 target_os = "fuchsia",
242 all(target_arch = "wasm32", feature = "stdweb"),
243 all(target_arch = "wasm32", feature = "wasm-bindgen"),
249 fn stmt_expr_attributes() {
258 MyEnum::Option1 if cfg!(target_os = "windows") =>
259 #[cfg(target_os = "windows")]
265 MyEnum::Option1 if cfg!(target_os = "windows") =>
267 #[cfg(target_os = "windows")]