macros: fix syn patch version

This commit is contained in:
David Hewitt 2022-03-21 23:53:08 +00:00
parent 143b7d368f
commit c734b116f9
4 changed files with 6 additions and 6 deletions

View File

@ -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

View File

@ -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"]

View File

@ -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" }

View File

@ -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()
}
}