1 // rustfmt-wrap_comments: true
2 // Test attributes and doc comments are preserved.
3 #![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
4 html_favicon_url = "https://doc.rust-lang.org/favicon.ico",
5 html_root_url = "https://doc.rust-lang.org/nightly/",
6 html_playground_url = "https://play.rust-lang.org/", test(attr(deny(warnings))))]
16 // Comment on attribute
33 fn foo(&mut self) -> isize {
57 // Another comment that needs rewrite because it's tooooooooooooooooooooooooooooooo loooooooooooong.
62 // We want spaces around `=`
63 #[cfg(feature="nightly")]
64 fn f5(self) -> Monkey {}
69 # [ derive ( Clone , PartialEq , Debug , Deserialize , Serialize ) ]
75 /// Default path (*nix)
76 #[cfg(all(unix, not(target_os = "macos"), not(target_os = "ios"), not(target_os = "android")))]
78 #[cfg(target_os = "freertos")]
80 'a' | 'A' => GpioPort { port_address: GPIO_A },
81 'b' | 'B' => GpioPort { port_address: GPIO_B },
85 #[cfg_attr(not(target_os = "freertos"), allow(unused_variables))]
91 #[should_panic(expected = "(")]
92 #[should_panic(expected = /* ( */ "(")]
93 #[should_panic(/* ((((( */expected /* ((((( */= /* ((((( */ "("/* ((((( */)]
96 (((((((((()(((((((( */
104 #[allow(unreachable_code)] // https://github.com/rust-lang/rust/issues/43336
107 #[allow(unreachable_code)]
108 // https://github.com/rust-lang/rust/issues/43336
112 // Formatting inner attributes
113 fn inner_attributes() {
114 #![ this_is_an_inner_attribute ( foo ) ]
119 impl InnerAttributes() {
120 #![ this_is_an_inner_attribute ( foo ) ]
125 mod InnerAttributes {
126 #![ this_is_an_inner_attribute ( foo ) ]
129 fn attributes_on_statements() {
131 # [ attr ( on ( local ) ) ]
135 # [ attr ( on ( item ) ) ]
139 # [ attr ( on ( expr ) ) ]
143 # [ attr ( on ( semi ) ) ]
147 # [ attr ( on ( mac ) ) ]
152 #[derive(Add, Sub, Mul, Div, Clone, Copy, Eq, PartialEq, Ord, PartialOrd, Debug, Hash, Serialize, Mul)]
158 #[derive(Add, Sub, Mul, Div, Clone, Copy, Eq, PartialEq, Ord, PartialOrd, Debug, Hash, Serialize, Deserialize)]
159 pub struct HP(pub u8);
161 // Long `#[doc = "..."]`
162 struct A { #[doc = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"] b: i32 }
165 #[cfg(feature = "this_line_is_101_characters_long_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")]
171 #[clippy::bar(a, b, c)]
175 #[derive(Debug, StructOpt)]
176 #[structopt(about = "Display information about the character on FF Logs")]
178 #[structopt(help = "The server the character is on")]
180 #[structopt(help = "The character's first name")]
182 #[structopt(help = "The character's last name")]
187 help = "The job to look at",
195 #[cfg(not(all(feature="std",
196 any(target_os = "linux", target_os = "android",
197 target_os = "netbsd",
198 target_os = "dragonfly",
200 target_os = "emscripten",
201 target_os = "solaris",
202 target_os = "cloudabi",
203 target_os = "macos", target_os = "ios",
204 target_os = "freebsd",
205 target_os = "openbsd", target_os = "bitrig",
207 target_os = "fuchsia",
209 all(target_arch = "wasm32", feature = "stdweb"),
210 all(target_arch = "wasm32", feature = "wasm-bindgen"),