1 #![warn(clippy::semicolon_if_nothing_returned)]
2 #![allow(clippy::redundant_closure)]
3 #![feature(label_break_value)]
8 // the functions below trigger the lint
30 fn unsafe_checks_error() {
31 use std::mem::MaybeUninit;
34 let mut s = MaybeUninit::<String>::uninit();
36 ptr::drop_in_place(s.as_mut_ptr())
41 fn print_sum(a: i32, b: i32) {
42 println!("{}", a + b);
43 assert_eq!(true, false);
70 fn loop_test(x: i32) {
72 for &ext in &["stdout", "stderr", "fixed"] {
83 let _d = || { hello() };
86 unsafe fn some_unsafe_op() {}
87 unsafe fn some_other_unsafe_fn() {}
90 unsafe { some_unsafe_op() };
92 unsafe { some_other_unsafe_fn() };
96 use std::mem::MaybeUninit;
99 let mut s = MaybeUninit::<String>::uninit();
100 let _d = || unsafe { ptr::drop_in_place(s.as_mut_ptr()) };
105 fn macro_with_semicolon() {
115 fn function_returning_option() -> Option<i32> {
120 fn let_else_stmts() {
121 let Some(x) = function_returning_option() else { return; };