Skip to content

Commit

Permalink
[proptest-derive] disable clippy::arc_with_non_send_sync (#365)
Browse files Browse the repository at this point in the history
This is a new lint added in Rust 1.72. See comment for why.
  • Loading branch information
sunshowers authored Aug 27, 2023
1 parent 4a9680a commit f754b23
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
7 changes: 7 additions & 0 deletions proptest-derive/src/ast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,15 @@ impl Impl {
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
// generated are often not Send or Sync, such as BoxedStrategy.
//
// The double-curly-braces are not strictly required, but allow the expression to be
// annotated with an attribute.
let q = quote! {
#[allow(non_upper_case_globals)]
#[allow(clippy::arc_with_non_send_sync)]
const #_const: () = {
extern crate proptest as _proptest;

Expand Down
3 changes: 3 additions & 0 deletions proptest-derive/src/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ test! {
struct MyUnitStruct;
} expands to {
#[allow(non_upper_case_globals)]
#[allow(clippy::arc_with_non_send_sync)]
const _IMPL_ARBITRARY_FOR_MyUnitStruct : () = {
extern crate proptest as _proptest;
impl _proptest::arbitrary::Arbitrary for MyUnitStruct {
Expand All @@ -99,6 +100,7 @@ test! {
struct MyTupleUnitStruct();
} expands to {
#[allow(non_upper_case_globals)]
#[allow(clippy::arc_with_non_send_sync)]
const _IMPL_ARBITRARY_FOR_MyTupleUnitStruct : () = {
extern crate proptest as _proptest;
impl _proptest::arbitrary::Arbitrary for MyTupleUnitStruct {
Expand All @@ -119,6 +121,7 @@ test! {
struct MyNamedUnitStruct {}
} expands to {
#[allow(non_upper_case_globals)]
#[allow(clippy::arc_with_non_send_sync)]
const _IMPL_ARBITRARY_FOR_MyNamedUnitStruct : () = {
extern crate proptest as _proptest;
impl _proptest::arbitrary::Arbitrary for MyNamedUnitStruct {
Expand Down

0 comments on commit f754b23

Please sign in to comment.