Skip to content

Commit

Permalink
Merge pull request #2240 from davidhewitt/syn-patch
Browse files Browse the repository at this point in the history
macros: fix syn patch version
  • Loading branch information
davidhewitt authored Mar 22, 2022
2 parents 143b7d3 + c734b11 commit d146a2a
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion pyo3-macros-backend/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]

Expand Down
2 changes: 1 addition & 1 deletion pyo3-macros/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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" }
6 changes: 3 additions & 3 deletions pyo3-macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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()
}
}
Expand Down

0 comments on commit d146a2a

Please sign in to comment.