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

deps: update to syn 2.0 #317

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion quickcheck_macros/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ proc-macro = true
[dependencies]
proc-macro2 = "1.0"
quote = "1.0"
syn = { version = "1.0", features = ["full"] }
syn = { version = "2.0", features = ["full"] }

[dev-dependencies]
quickcheck = { path = "..", version = "1.0.0" }
9 changes: 8 additions & 1 deletion quickcheck_macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,21 @@ pub fn quickcheck(_args: TokenStream, input: TokenStream) -> TokenStream {
if errors.is_empty() {
let attrs = mem::replace(&mut item_fn.attrs, Vec::new());
let name = &item_fn.sig.ident;
if let Some(variadic) = &item_fn.sig.variadic {
// variadics are just for `extern fn`
errors.push(syn::parse::Error::new(
variadic.span(),
"unsupported variadic",
));
}
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In syn 2.0 TypeBareFn changed to use BareVariadic instead of Variadic used by Signature. I can't see any obvious way to convert between the two kinds of variadics but not sure quickcheck even works for variadic functions 🤔

let fn_type = syn::TypeBareFn {
lifetimes: None,
unsafety: item_fn.sig.unsafety.clone(),
abi: item_fn.sig.abi.clone(),
fn_token: <syn::Token![fn]>::default(),
paren_token: syn::token::Paren::default(),
inputs,
variadic: item_fn.sig.variadic.clone(),
variadic: None,
output: item_fn.sig.output.clone(),
};

Expand Down