You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
M Cargo.toml
@@ -22,7 +22,7 @@ name = "starlark"
starlark = "^0.10.0"
starlark_derive = "^0.10.0"
anyhow = "^1.0.65"
-pyo3 = { version = "0.21.2", features = ["extension-module"] }
+pyo3 = { version = "0.22", features = ["extension-module"] }
# needed to resolve contradictory constraints in dependencies
syn = "^1.0.96"
M src/lib.rs
@@ -680,7 +680,7 @@ impl Module {
self.0.set(name, b);
}
- fn freeze(mod_cell: &PyCell<Module>) -> PyResult<FrozenModule> {
+ fn freeze(mod_cell: &Bound<Module>) -> PyResult<FrozenModule> {
let module = mod_cell
.replace(Module(starlark::environment::Module::new()))
.0;
@@ -752,7 +752,7 @@ fn empty_ast() -> AstModule {
)]
fn eval(
module: &mut Module,
- ast: &PyCell<AstModule>,
+ ast: &Bound<AstModule>,
globals: &Globals,
file_loader: Option<&Bound<FileLoader>>,
) -> PyResult<PyObject> {
But it's not a drop-in replacement:
error[E0599]: no method named `replace` found for reference `&pyo3::Bound<'_, Module>` in the current scope
--> src/lib.rs:685:14
|
684 | let module = mod_cell
| ______________________-
685 | | .replace(Module(starlark::environment::Module::new()))
| | -^^^^^^^ method not found in `&Bound<'_, Module>`
| |_____________|
|
error[E0599]: no method named `replace` found for reference `&pyo3::Bound<'_, AstModule>` in the current scope
--> src/lib.rs:763:39
|
763 | evaluator.eval_module(ast.replace(empty_ast()).0, &globals.0),
| ^^^^^^^ method not found in `&Bound<'_, AstModule>`
The text was updated successfully, but these errors were encountered:
I tried this, too, and I got stuck in the same places you did. 🙂 I'll spend the time at some point to get this to go. In the meantime, any help would be more than welcome.
pyo3 supports 3.13
I tried giving this a shot:
But it's not a drop-in replacement:
The text was updated successfully, but these errors were encountered: