forked from PyO3/pyo3
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinvalid_closure.stderr
More file actions
22 lines (20 loc) · 1.01 KB
/
Copy pathinvalid_closure.stderr
File metadata and controls
22 lines (20 loc) · 1.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
error[E0597]: `local_data` does not live long enough
--> tests/ui/invalid_closure.rs:8:27
|
7 | let local_data = vec![0, 1, 2, 3, 4];
| ---------- binding `local_data` declared here
8 | let ref_: &[u8] = &local_data;
| ^^^^^^^^^^^ borrowed value does not live long enough
...
16 | PyCFunction::new_closure(py, None, None, closure_fn).unwrap();
| ---------------------------------------------------- argument requires that `local_data` is borrowed for `'static`
17 | });
| - `local_data` dropped here while still borrowed
|
note: requirement that the value outlives `'static` introduced here
--> src/types/function.rs
|
| F: Fn(&Bound<'_, PyTuple>, Option<&Bound<'_, PyDict>>) -> R + Send + Sync + 'static,
| ^^^^^^^
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0597`.