2021-10-03 19:37:17 +00:00
|
|
|
error[E0597]: `local_data` does not live long enough
|
|
|
|
--> tests/ui/invalid_closure.rs:7:27
|
|
|
|
|
|
2023-07-14 09:28:17 +00:00
|
|
|
6 | let local_data = vec![0, 1, 2, 3, 4];
|
|
|
|
| ---------- binding `local_data` declared here
|
2021-10-03 19:37:17 +00:00
|
|
|
7 | let ref_: &[u8] = &local_data;
|
|
|
|
| ^^^^^^^^^^^ borrowed value does not live long enough
|
|
|
|
...
|
2024-02-23 14:07:54 +00:00
|
|
|
14 | PyCFunction::new_closure_bound(py, None, None, closure_fn)
|
2024-02-05 07:51:18 +00:00
|
|
|
| ---------------------------------------------------------- argument requires that `local_data` is borrowed for `'static`
|
|
|
|
...
|
2024-02-23 14:07:54 +00:00
|
|
|
17 | });
|
2021-10-03 19:37:17 +00:00
|
|
|
| - `local_data` dropped here while still borrowed
|