1 #![warn(clippy::semicolon_if_nothing_returned)]
2 #![allow(clippy::redundant_closure, clippy::uninlined_format_args)]
6 // the functions below trigger the lint
28 fn unsafe_checks_error() {
29 use std::mem::MaybeUninit;
32 let mut s = MaybeUninit::<String>::uninit();
34 ptr::drop_in_place(s.as_mut_ptr())
39 fn print_sum(a: i32, b: i32) {
40 println!("{}", a + b);
41 assert_eq!(true, false);
68 fn loop_test(x: i32) {
70 for &ext in &["stdout", "stderr", "fixed"] {
81 let _d = || { hello() };
84 unsafe fn some_unsafe_op() {}
85 unsafe fn some_other_unsafe_fn() {}
88 unsafe { some_unsafe_op() };
90 unsafe { some_other_unsafe_fn() };
94 use std::mem::MaybeUninit;
97 let mut s = MaybeUninit::<String>::uninit();
98 let _d = || unsafe { ptr::drop_in_place(s.as_mut_ptr()) };
103 fn macro_with_semicolon() {
113 fn function_returning_option() -> Option<i32> {
118 fn let_else_stmts() {
119 let Some(x) = function_returning_option() else { return; };