From f19ffdd237800c841ba518d67489bc680b6f78ba Mon Sep 17 00:00:00 2001 From: Alexey Shekhirin Date: Mon, 26 Feb 2024 11:45:39 +0000 Subject: [PATCH 1/2] fix: use anon-const for wrapping expanded impls --- proptest-derive/src/ast.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/proptest-derive/src/ast.rs b/proptest-derive/src/ast.rs index 178a09e3..ff43b8b9 100644 --- a/proptest-derive/src/ast.rs +++ b/proptest-derive/src/ast.rs @@ -106,8 +106,6 @@ impl Impl { let _top = call_site_ident(TOP_PARAM_NAME); - let _const = call_site_ident(&format!("_IMPL_ARBITRARY_FOR_{}", typ)); - // Linearise everything. We're done after this. // // NOTE: The clippy::arc_with_non_send_sync lint is disabled here because the strategies @@ -118,7 +116,7 @@ impl Impl { let q = quote! { #[allow(non_upper_case_globals)] #[allow(clippy::arc_with_non_send_sync)] - const #_const: () = { + const _: () = { extern crate proptest as _proptest; impl #impl_generics _proptest::arbitrary::Arbitrary From 18c9cee20a92bbd7a09bec747677d68ca30b3811 Mon Sep 17 00:00:00 2001 From: Alexey Shekhirin Date: Wed, 28 Feb 2024 09:28:11 +0000 Subject: [PATCH 2/2] fix derive tests --- proptest-derive/src/tests.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/proptest-derive/src/tests.rs b/proptest-derive/src/tests.rs index 788a6e7c..10d80614 100644 --- a/proptest-derive/src/tests.rs +++ b/proptest-derive/src/tests.rs @@ -80,7 +80,7 @@ test! { } expands to { #[allow(non_upper_case_globals)] #[allow(clippy::arc_with_non_send_sync)] - const _IMPL_ARBITRARY_FOR_MyUnitStruct : () = { + const _: () = { extern crate proptest as _proptest; impl _proptest::arbitrary::Arbitrary for MyUnitStruct { type Parameters = (); @@ -101,7 +101,7 @@ test! { } expands to { #[allow(non_upper_case_globals)] #[allow(clippy::arc_with_non_send_sync)] - const _IMPL_ARBITRARY_FOR_MyTupleUnitStruct : () = { + const _: () = { extern crate proptest as _proptest; impl _proptest::arbitrary::Arbitrary for MyTupleUnitStruct { type Parameters = (); @@ -122,7 +122,7 @@ test! { } expands to { #[allow(non_upper_case_globals)] #[allow(clippy::arc_with_non_send_sync)] - const _IMPL_ARBITRARY_FOR_MyNamedUnitStruct : () = { + const _: () = { extern crate proptest as _proptest; impl _proptest::arbitrary::Arbitrary for MyNamedUnitStruct { type Parameters = ();