1 // rustfmt-wrap_comments: true
2 // Test attributes and doc comments are preserved.
12 // Comment on attribute
32 fn foo(&mut self) -> isize {
56 // Another comment that needs rewrite because it's tooooooooooooooooooooooooooooooo loooooooooooong.
61 // We want spaces around `=`
62 #[cfg(feature="nightly")]
63 fn f5(self) -> Monkey {}
68 # [ derive ( Clone , PartialEq , Debug , Deserialize , Serialize ) ]
74 /// Default path (*nix)
75 #[cfg(all(unix, not(target_os = "macos"), not(target_os = "ios"), not(target_os = "android")))]
77 #[cfg(target_os = "freertos")]
79 'a' | 'A' => GpioPort { port_address: GPIO_A },
80 'b' | 'B' => GpioPort { port_address: GPIO_B },
84 #[cfg_attr(not(target_os = "freertos"), allow(unused_variables))]
90 #[should_panic(expected = "(")]
91 #[should_panic(expected = /* ( */ "(")]
92 #[should_panic(/* ((((( */expected /* ((((( */= /* ((((( */ "("/* ((((( */)]
95 (((((((((()(((((((( */
103 #[allow(unreachable_code)] // https://github.com/rust-lang/rust/issues/43336
106 #[allow(unreachable_code)]
107 // https://github.com/rust-lang/rust/issues/43336
111 // Formatting inner attributes
112 fn inner_attributes() {
113 #![ this_is_an_inner_attribute ( foo ) ]
118 impl InnerAttributes() {
119 #![ this_is_an_inner_attribute ( foo ) ]
124 mod InnerAttributes {
125 #![ this_is_an_inner_attribute ( foo ) ]
128 fn attributes_on_statements() {
130 # [ attr ( on ( local ) ) ]
134 # [ attr ( on ( item ) ) ]
138 # [ attr ( on ( expr ) ) ]
142 # [ attr ( on ( semi ) ) ]
146 # [ attr ( on ( mac ) ) ]