// Exhaustively tests that macros work when linting against `unsafe`. #![forbid(unsafe_code)] use divan::Bencher; const CONST_VALUES: [usize; 3] = [1, 5, 10]; #[divan::bench] fn freestanding() {} #[divan::bench(types = [i32, &str])] fn freestanding_generic_type() {} #[divan::bench(consts = [1, 5, 10])] fn freestanding_generic_const1() {} #[divan::bench(consts = CONST_VALUES)] fn freestanding_generic_const2() {} #[divan::bench(types = [i32, &str], consts = [1, 5, 10])] fn freestanding_generic_type_const1() {} #[divan::bench(types = [i32, &str], consts = CONST_VALUES)] fn freestanding_generic_type_const2() {} #[divan::bench] fn contextual(_: Bencher) {} #[divan::bench(types = [i32, &str])] fn contextual_generic_type(_: Bencher) {} #[divan::bench(consts = [1, 5, 10])] fn contextual_generic_const_1(_: Bencher) {} #[divan::bench(consts = CONST_VALUES)] fn contextual_generic_const_2(_: Bencher) {} #[divan::bench(types = [i32, &str], consts = [1, 5, 10])] fn contextual_generic_type_const_1(_: Bencher) {} #[divan::bench(types = [i32, &str], consts = CONST_VALUES)] fn contextual_generic_type_const_2(_: Bencher) {} #[divan::bench_group] mod group { use super::*; #[divan::bench] fn freestanding() {} #[divan::bench(types = [i32, &str])] fn freestanding_generic_type() {} #[divan::bench(consts = [1, 5, 10])] fn freestanding_generic_const1() {} #[divan::bench(consts = CONST_VALUES)] fn freestanding_generic_const2() {} #[divan::bench(types = [i32, &str], consts = [1, 5, 10])] fn freestanding_generic_type_const1() {} #[divan::bench(types = [i32, &str], consts = CONST_VALUES)] fn freestanding_generic_type_const2() {} #[divan::bench] fn contextual(_: Bencher) {} #[divan::bench(types = [i32, &str])] fn contextual_generic_type(_: Bencher) {} #[divan::bench(consts = [1, 5, 10])] fn contextual_generic_const1(_: Bencher) {} #[divan::bench(consts = CONST_VALUES)] fn contextual_generic_const2(_: Bencher) {} #[divan::bench(types = [i32, &str], consts = [1, 5, 10])] fn contextual_generic_type_const1(_: Bencher) {} #[divan::bench(types = [i32, &str], consts = CONST_VALUES)] fn contextual_generic_type_const2(_: Bencher) {} }