pyo3/tests/ui/wrong_aspyref_lifetimes.rs

12 lines
313 B
Rust
Raw Normal View History

2021-08-01 21:41:32 +00:00
use pyo3::{types::PyDict, Py, Python};
fn main() {
2022-08-15 01:34:47 +00:00
#[allow(deprecated)]
let gil = Python::acquire_gil();
let dict: Py<PyDict> = PyDict::new(gil.python()).into();
let dict: &PyDict = dict.as_ref(gil.python());
drop(gil);
let _py: Python = dict.py(); // Obtain a Python<'p> without GIL.
}