1 #![warn(clippy::undocumented_unsafe_blocks)]
51 fn local_tuple_expression() {
53 let _ = (42, unsafe {});
61 fn line_comment_newlines() {
67 fn line_comment_empty() {
75 fn line_comment_with_extras() {
76 // This is a description
86 fn block_comment_newlines() {
92 fn block_comment_with_extras() {
93 /* This is a description
99 fn block_comment_terminator_same_line() {
100 /* This is a description
106 // Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor
107 // incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation
108 // ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in
109 // reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint
110 // occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est
112 // Tellus elementum sagittis vitae et leo duis ut diam quam. Sit amet nulla facilisi
113 // morbi tempus iaculis urna. Amet luctus venenatis lectus magna. At quis risus sed vulputate odio
114 // ut. Luctus venenatis lectus magna fringilla urna. Tortor id aliquet lectus proin nibh nisl
115 // condimentum id venenatis. Vulputate dignissim suspendisse in est ante in nibh mauris cursus.
119 fn safety_with_prepended_text() {
120 // This is a test. safety:
124 fn local_line_comment() {
129 fn local_block_comment() {
136 let _ = [unsafe { 14 }, unsafe { 15 }, 42, unsafe { 16 }];
141 let _ = (42, unsafe {}, "test", unsafe {});
146 let _ = *unsafe { &42 };
149 #[allow(clippy::match_single_binding)]
152 let _ = match unsafe {} {
157 fn comment_addr_of() {
162 fn comment_repeat() {
164 let _ = [unsafe {}; 5];
167 fn comment_macro_call() {
180 fn comment_macro_def() {
191 fn non_ascii_comment() {
196 fn local_commented_block() {
204 let _ = [(42, unsafe {}, unsafe {}), (52, unsafe {}, unsafe {})];
207 fn in_fn_call(x: *const u32) {
214 fn multi_in_fn_call(x: *const u32) {
215 fn f(x: u32, y: u32) {}
218 f(unsafe { *x }, unsafe { *x });
221 fn in_multiline_fn_call(x: *const u32) {
222 fn f(x: u32, y: u32) {}
231 fn in_macro_call(x: *const u32) {
233 println!("{}", unsafe { *x });
236 fn in_multiline_macro_call(x: *const u32) {
250 fn no_comment_array() {
251 let _ = [unsafe { 14 }, unsafe { 15 }, 42, unsafe { 16 }];
254 fn no_comment_tuple() {
255 let _ = (42, unsafe {}, "test", unsafe {});
258 fn no_comment_unary() {
259 let _ = *unsafe { &42 };
262 #[allow(clippy::match_single_binding)]
263 fn no_comment_match() {
264 let _ = match unsafe {} {
269 fn no_comment_addr_of() {
273 fn no_comment_repeat() {
274 let _ = [unsafe {}; 5];
277 fn local_no_comment() {
281 fn no_comment_macro_call() {
291 fn no_comment_macro_def() {
301 fn trailing_comment() {
305 fn internal_comment() {
319 pub fn print_binary_tree() {
320 println!("{}", unsafe { String::from_utf8_unchecked(vec![]) });