dcab478d66
* Fix lifetime safety bug of AsPyRef::as_ref(). Fixes #875. * Add test for AsPyRef's lifetimes.
11 lines
433 B
Plaintext
11 lines
433 B
Plaintext
error[E0505]: cannot move out of `gil` because it is borrowed
|
|
--> $DIR/wrong_aspyref_lifetimes.rs:7:10
|
|
|
|
|
6 | let dict: &PyDict = dict.as_ref(gil.python());
|
|
| --- borrow of `gil` occurs here
|
|
7 | drop(gil);
|
|
| ^^^ move out of `gil` occurs here
|
|
8 |
|
|
9 | let _py: Python = dict.py(); // Obtain a Python<'p> without GIL.
|
|
| ---- borrow later used here
|