diff --git a/CHANGELOG.md b/CHANGELOG.md index 9615c5a1..e56e57d2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,8 +11,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - Considered `PYTHONFRAMEWORK` when cross compiling in order that on macos cross compiling against a [Framework bundle](https://developer.apple.com/library/archive/documentation/MacOSX/Conceptual/BPFrameworks/Concepts/FrameworkAnatomy.html) is considered shared. [#2233](https://github.com/PyO3/pyo3/pull/2233) - - Panic during compilation when `PYO3_CROSS_LIB_DIR` is set for some host/target combinations. [#2232](https://github.com/PyO3/pyo3/pull/2232) +- Correct dependency version for `syn` to require correct minimal patch version 1.0.56. [#2240](https://github.com/PyO3/pyo3/pull/2240) ### Added diff --git a/pyo3-macros-backend/Cargo.toml b/pyo3-macros-backend/Cargo.toml index ee59dc8a..8d6ff323 100644 --- a/pyo3-macros-backend/Cargo.toml +++ b/pyo3-macros-backend/Cargo.toml @@ -19,7 +19,7 @@ proc-macro2 = { version = "1", default-features = false } pyo3-build-config = { path = "../pyo3-build-config", version = "0.16.2", features = ["resolve-config"] } [dependencies.syn] -version = "1" +version = "1.0.56" default-features = false features = ["derive", "parsing", "printing", "clone-impls", "full", "extra-traits"] diff --git a/pyo3-macros/Cargo.toml b/pyo3-macros/Cargo.toml index 927b2ad3..08bd5c5f 100644 --- a/pyo3-macros/Cargo.toml +++ b/pyo3-macros/Cargo.toml @@ -21,5 +21,5 @@ pyproto = ["pyo3-macros-backend/pyproto"] [dependencies] proc-macro2 = { version = "1", default-features = false } quote = "1" -syn = { version = "1", features = ["full", "extra-traits"] } +syn = { version = "1.0.56", features = ["full", "extra-traits"] } pyo3-macros-backend = { path = "../pyo3-macros-backend", version = "=0.16.2" } diff --git a/pyo3-macros/src/lib.rs b/pyo3-macros/src/lib.rs index 06738053..d21db179 100644 --- a/pyo3-macros/src/lib.rs +++ b/pyo3-macros/src/lib.rs @@ -38,11 +38,11 @@ pub fn pymodule(args: TokenStream, input: TokenStream) -> TokenStream { let mut ast = parse_macro_input!(input as syn::ItemFn); let options = match PyModuleOptions::from_attrs(&mut ast.attrs) { Ok(options) => options, - Err(e) => return e.to_compile_error().into(), + Err(e) => return e.into_compile_error().into(), }; if let Err(err) = process_functions_in_module(&mut ast) { - return err.to_compile_error().into(); + return err.into_compile_error().into(); } let doc = get_doc(&ast.attrs, None); @@ -114,7 +114,7 @@ pub fn pyclass(attr: TokenStream, input: TokenStream) -> TokenStream { Item::Enum(enum_) => pyclass_enum_impl(attr, enum_, methods_type()), unsupported => { syn::Error::new_spanned(unsupported, "#[pyclass] only supports structs and enums.") - .to_compile_error() + .into_compile_error() .into() } }