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
36 fn foo(&mut self) -> isize {
60 // Another comment that needs rewrite because it's tooooooooooooooooooooooooooooooo loooooooooooong.
65 // We want spaces around `=`
66 #[cfg(feature="nightly")]
67 fn f5(self) -> Monkey {}
72 # [ derive ( Clone , PartialEq , Debug , Deserialize , Serialize ) ]
78 /// Default path (*nix)
79 #[cfg(all(unix, not(target_os = "macos"), not(target_os = "ios"), not(target_os = "android")))]
81 #[cfg(target_os = "freertos")]
83 'a' | 'A' => GpioPort { port_address: GPIO_A },
84 'b' | 'B' => GpioPort { port_address: GPIO_B },
88 #[cfg_attr(not(target_os = "freertos"), allow(unused_variables))]
94 #[should_panic(expected = "(")]
95 #[should_panic(expected = /* ( */ "(")]
96 #[should_panic(/* ((((( */expected /* ((((( */= /* ((((( */ "("/* ((((( */)]
99 (((((((((()(((((((( */
107 #[allow(unreachable_code)] // https://github.com/rust-lang/rust/issues/43336
110 #[allow(unreachable_code)]
111 // https://github.com/rust-lang/rust/issues/43336
115 // Formatting inner attributes
116 fn inner_attributes() {
117 #![ this_is_an_inner_attribute ( foo ) ]
122 impl InnerAttributes() {
123 #![ this_is_an_inner_attribute ( foo ) ]
128 mod InnerAttributes {
129 #![ this_is_an_inner_attribute ( foo ) ]
132 fn attributes_on_statements() {
134 # [ attr ( on ( local ) ) ]
138 # [ attr ( on ( item ) ) ]
142 # [ attr ( on ( expr ) ) ]
146 # [ attr ( on ( semi ) ) ]
150 # [ attr ( on ( mac ) ) ]
155 #[derive(Add, Sub, Mul, Div, Clone, Copy, Eq, PartialEq, Ord, PartialOrd, Debug, Hash, Serialize, Deserialize)]
156 pub struct HP(pub u8);
158 // Long `#[doc = "..."]`
159 struct A { #[doc = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"] b: i32 }