-
Notifications
You must be signed in to change notification settings - Fork 677
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move locking the GIL and handling the resulting panics into a library…
… function.
- Loading branch information
1 parent
31a3da1
commit d6fb513
Showing
7 changed files
with
80 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,5 +19,3 @@ pub mod pymethods; | |
pub mod pymodule; | ||
#[doc(hidden)] | ||
pub mod trampoline; | ||
|
||
pub use crate::gil::LockGIL; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
use pyo3::prelude::*; | ||
use pyo3::PyVisit; | ||
|
||
#[pyclass] | ||
struct TraverseTriesToTakePyRef {} | ||
|
||
#[pymethods] | ||
impl TraverseTriesToTakePyRef { | ||
fn __traverse__(slf: PyRef<Self>, visit: PyVisit) {} | ||
} | ||
|
||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
error[E0308]: mismatched types | ||
--> tests/ui/traverse_bare_self.rs:8:6 | ||
| | ||
7 | #[pymethods] | ||
| ------------ arguments to this function are incorrect | ||
8 | impl TraverseTriesToTakePyRef { | ||
| ______^ | ||
9 | | fn __traverse__(slf: PyRef<Self>, visit: PyVisit) {} | ||
| |___________________^ expected fn pointer, found fn item | ||
| | ||
= note: expected fn pointer `for<'a, 'b> fn(&'a TraverseTriesToTakePyRef, PyVisit<'b>) -> Result<(), PyTraverseError>` | ||
found fn item `for<'a, 'b> fn(pyo3::PyRef<'a, TraverseTriesToTakePyRef>, PyVisit<'b>) {TraverseTriesToTakePyRef::__traverse__}` | ||
note: function defined here | ||
--> src/impl_/pymethods.rs | ||
| | ||
| pub unsafe fn call_traverse_impl<T>( | ||
| ^^^^^^^^^^^^^^^^^^ |