pyo3/tests/ui/invalid_closure.stderr
Lily Foote e145ae851a
Update new_closure_bound closure signature (#3883)
* Update new_closure_bound closure signature

Co-authored-by: Icxolu <10486322+Icxolu@users.noreply.github.com>

* Use anonymous lifetimes in closure bounds

Co-authored-by: David Hewitt <mail@davidhewitt.dev>

* Take &Bound in PyCFunction closures

---------

Co-authored-by: Icxolu <10486322+Icxolu@users.noreply.github.com>
Co-authored-by: David Hewitt <mail@davidhewitt.dev>
2024-02-23 14:07:54 +00:00

14 lines
624 B
Plaintext

error[E0597]: `local_data` does not live long enough
--> tests/ui/invalid_closure.rs:7:27
|
6 | let local_data = vec![0, 1, 2, 3, 4];
| ---------- binding `local_data` declared here
7 | let ref_: &[u8] = &local_data;
| ^^^^^^^^^^^ borrowed value does not live long enough
...
14 | PyCFunction::new_closure_bound(py, None, None, closure_fn)
| ---------------------------------------------------------- argument requires that `local_data` is borrowed for `'static`
...
17 | });
| - `local_data` dropped here while still borrowed