Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: use anon-const for wrapping expanded impls #427

Merged
merged 2 commits into from
Mar 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions proptest-derive/src/ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
6 changes: 3 additions & 3 deletions proptest-derive/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 = ();
Expand All @@ -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 = ();
Expand All @@ -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 = ();
Expand Down
Loading