From ba663a43a16e62c58cfaf7b2af9746e579466fe7 Mon Sep 17 00:00:00 2001 From: Veetaha Date: Wed, 8 Oct 2025 11:50:39 +0000 Subject: [PATCH] Add a regression test for `clippy::wrong_self_convention` --- bon/tests/integration/builder/lints.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/bon/tests/integration/builder/lints.rs b/bon/tests/integration/builder/lints.rs index 2c3e02e4..eeb4809a 100644 --- a/bon/tests/integration/builder/lints.rs +++ b/bon/tests/integration/builder/lints.rs @@ -10,3 +10,16 @@ fn func_with_skipped_generic_arg() { sut().arg(&32).call(); } + +// Test for https://github.com/elastio/bon/pull/349 +#[test] +fn clippy_wrong_self_convention() { + // This used to trigger the `clippy::wrong_self_convention` lint + #[derive(Builder)] + struct Sut { + is_unique: bool, + } + + let value = Sut::builder().is_unique(true).build(); + let _ = value.is_unique; +}