1
- error: lifetime may not live long enough
1
+ error[E0521]: borrowed data escapes outside of function
2
2
--> tests/ui/static_ref.rs:4:1
3
3
|
4
4
4 | #[pyfunction]
5
5
| ^^^^^^^^^^^^^
6
6
| |
7
+ | `py` is a reference that is only valid in the function body
8
+ | `py` escapes the function body here
7
9
| lifetime `'py` defined here
8
- | coercion requires that `'py` must outlive `'static`
10
+ | argument requires that `'py` must outlive `'static`
9
11
|
10
12
= note: this error originates in the attribute macro `pyfunction` (in Nightly builds, run with -Z macro-backtrace for more info)
11
13
@@ -29,19 +31,19 @@ error[E0597]: `holder_0` does not live long enough
29
31
| | |
30
32
| | `holder_0` dropped here while still borrowed
31
33
| binding `holder_0` declared here
34
+ | argument requires that `holder_0` is borrowed for `'static`
32
35
5 | fn static_ref(list: &'static Bound<'_, PyList>) -> usize {
33
- | ^^^^^^-
34
- | | |
35
- | | argument requires that `holder_0` is borrowed for `'static`
36
- | borrowed value does not live long enough
36
+ | ^^^^^^^ borrowed value does not live long enough
37
37
38
- error: lifetime may not live long enough
38
+ error[E0521]: borrowed data escapes outside of function
39
39
--> tests/ui/static_ref.rs:9:1
40
40
|
41
41
9 | #[pyfunction]
42
42
| ^^^^^^^^^^^^^
43
43
| |
44
+ | `py` is a reference that is only valid in the function body
45
+ | `py` escapes the function body here
44
46
| lifetime `'py` defined here
45
- | coercion requires that `'py` must outlive `'static`
47
+ | argument requires that `'py` must outlive `'static`
46
48
|
47
49
= note: this error originates in the attribute macro `pyfunction` (in Nightly builds, run with -Z macro-backtrace for more info)
0 commit comments