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 #[doc = "an attribute that shouldn't be normalized to a doc comment"]
34 fn foo(&mut self) -> isize {
58 // Another comment that needs rewrite because it's tooooooooooooooooooooooooooooooo loooooooooooong.
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)
77 #[cfg(all(unix, not(target_os = "macos"), not(target_os = "ios"), not(target_os = "android")))]
79 #[cfg(target_os = "freertos")]
81 'a' | 'A' => GpioPort { port_address: GPIO_A },
82 'b' | 'B' => GpioPort { port_address: GPIO_B },
86 #[cfg_attr(not(target_os = "freertos"), allow(unused_variables))]
92 #[should_panic(expected = "(")]
93 #[should_panic(expected = /* ( */ "(")]
94 #[should_panic(/* ((((( */expected /* ((((( */= /* ((((( */ "("/* ((((( */)]
97 (((((((((()(((((((( */
105 #[allow(unreachable_code)] // https://github.com/rust-lang/rust/issues/43336
108 #[allow(unreachable_code)]
109 // https://github.com/rust-lang/rust/issues/43336
113 // Formatting inner attributes
114 fn inner_attributes() {
115 #![ this_is_an_inner_attribute ( foo ) ]
120 impl InnerAttributes() {
121 #![ this_is_an_inner_attribute ( foo ) ]
126 mod InnerAttributes {
127 #![ this_is_an_inner_attribute ( foo ) ]
130 fn attributes_on_statements() {
132 # [ attr ( on ( local ) ) ]
136 # [ attr ( on ( item ) ) ]
140 # [ attr ( on ( expr ) ) ]
144 # [ attr ( on ( semi ) ) ]
148 # [ attr ( on ( mac ) ) ]
153 #[derive(Add, Sub, Mul, Div, Clone, Copy, Eq, PartialEq, Ord, PartialOrd, Debug, Hash, Serialize, Mul)]
159 #[derive(Add, Sub, Mul, Div, Clone, Copy, Eq, PartialEq, Ord, PartialOrd, Debug, Hash, Serialize, Deserialize)]
160 pub struct HP(pub u8);
162 // Long `#[doc = "..."]`
163 struct A { #[doc = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"] b: i32 }
166 #[cfg(feature = "this_line_is_101_characters_long_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")]
172 #[clippy::bar(a, b, c)]
176 #[derive(Debug, StructOpt)]
177 #[structopt(about = "Display information about the character on FF Logs")]
179 #[structopt(help = "The server the character is on")]
181 #[structopt(help = "The character's first name")]
183 #[structopt(help = "The character's last name")]
188 help = "The job to look at",
196 #[cfg(not(all(feature="std",
197 any(target_os = "linux", target_os = "android",
198 target_os = "netbsd",
199 target_os = "dragonfly",
201 target_os = "emscripten",
202 target_os = "solaris",
203 target_os = "cloudabi",
204 target_os = "macos", target_os = "ios",
205 target_os = "freebsd",
206 target_os = "openbsd", target_os = "bitrig",
208 target_os = "fuchsia",
210 all(target_arch = "wasm32", feature = "stdweb"),
211 all(target_arch = "wasm32", feature = "wasm-bindgen"),