bon_sandbox/macro_rules_wrapper_test.rs
1// This is extremely perplexing, but by wrapping the struct in a macro, the lints
2// such as `private_bounds` or `clippy::missing_const_for_fn` are triggered if
3// code generated by `bon` violates it. Without it no lint is triggered.
4macro_rules! test {
5 () => {
6 #[derive(bon::Builder)]
7 pub struct WrappedByMacroRules {
8 _field: u32,
9 }
10 };
11}
12
13test!();