Skip to content

Commit cb22950

Browse files
authored
ci: updates for Rust 1.88 (PyO3#5215)
1 parent 9f1f1d0 commit cb22950

File tree

3 files changed

+74
-29
lines changed

3 files changed

+74
-29
lines changed

tests/ui/invalid_frozen_pyclass_borrow.stderr

Lines changed: 42 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,33 +8,49 @@ error[E0271]: type mismatch resolving `<Foo as PyClass>::Frozen == False`
88
--> tests/ui/invalid_frozen_pyclass_borrow.rs:11:19
99
|
1010
11 | fn mut_method(&mut self) {}
11-
| ^ expected `False`, found `True`
11+
| ^ type mismatch resolving `<Foo as PyClass>::Frozen == False`
1212
|
13+
note: expected this to be `False`
14+
--> tests/ui/invalid_frozen_pyclass_borrow.rs:3:1
15+
|
16+
3 | #[pyclass(frozen)]
17+
| ^^^^^^^^^^^^^^^^^^
1318
note: required by a bound in `extract_pyclass_ref_mut`
1419
--> src/impl_/extract_argument.rs
1520
|
1621
| pub fn extract_pyclass_ref_mut<'a, 'py: 'a, T: PyClass<Frozen = False>>(
1722
| ^^^^^^^^^^^^^^ required by this bound in `extract_pyclass_ref_mut`
23+
= note: this error originates in the attribute macro `pyclass` (in Nightly builds, run with -Z macro-backtrace for more info)
1824

1925
error[E0271]: type mismatch resolving `<Foo as PyClass>::Frozen == False`
2026
--> tests/ui/invalid_frozen_pyclass_borrow.rs:9:1
2127
|
2228
9 | #[pymethods]
23-
| ^^^^^^^^^^^^ expected `False`, found `True`
29+
| ^^^^^^^^^^^^ type mismatch resolving `<Foo as PyClass>::Frozen == False`
30+
|
31+
note: expected this to be `False`
32+
--> tests/ui/invalid_frozen_pyclass_borrow.rs:3:1
2433
|
34+
3 | #[pyclass(frozen)]
35+
| ^^^^^^^^^^^^^^^^^^
2536
note: required by a bound in `PyRefMut`
2637
--> src/pycell.rs
2738
|
2839
| pub struct PyRefMut<'p, T: PyClass<Frozen = False>> {
2940
| ^^^^^^^^^^^^^^ required by this bound in `PyRefMut`
30-
= note: this error originates in the attribute macro `pymethods` (in Nightly builds, run with -Z macro-backtrace for more info)
41+
= note: this error originates in the attribute macro `pymethods` which comes from the expansion of the attribute macro `pyclass` (in Nightly builds, run with -Z macro-backtrace for more info)
3142

3243
error[E0271]: type mismatch resolving `<Foo as PyClass>::Frozen == False`
3344
--> tests/ui/invalid_frozen_pyclass_borrow.rs:15:31
3445
|
3546
15 | let borrow = foo.bind(py).borrow_mut();
36-
| ^^^^^^^^^^ expected `False`, found `True`
47+
| ^^^^^^^^^^ type mismatch resolving `<Foo as PyClass>::Frozen == False`
48+
|
49+
note: expected this to be `False`
50+
--> tests/ui/invalid_frozen_pyclass_borrow.rs:3:1
3751
|
52+
3 | #[pyclass(frozen)]
53+
| ^^^^^^^^^^^^^^^^^^
3854
note: required by a bound in `pyo3::Bound::<'py, T>::borrow_mut`
3955
--> src/instance.rs
4056
|
@@ -43,13 +59,19 @@ note: required by a bound in `pyo3::Bound::<'py, T>::borrow_mut`
4359
| where
4460
| T: PyClass<Frozen = False>,
4561
| ^^^^^^^^^^^^^^ required by this bound in `Bound::<'py, T>::borrow_mut`
62+
= note: this error originates in the attribute macro `pyclass` (in Nightly builds, run with -Z macro-backtrace for more info)
4663

4764
error[E0271]: type mismatch resolving `<ImmutableChild as PyClass>::Frozen == False`
4865
--> tests/ui/invalid_frozen_pyclass_borrow.rs:25:33
4966
|
5067
25 | let borrow = child.bind(py).borrow_mut();
51-
| ^^^^^^^^^^ expected `False`, found `True`
68+
| ^^^^^^^^^^ type mismatch resolving `<ImmutableChild as PyClass>::Frozen == False`
5269
|
70+
note: expected this to be `False`
71+
--> tests/ui/invalid_frozen_pyclass_borrow.rs:21:1
72+
|
73+
21 | #[pyclass(frozen, extends = MutableBase)]
74+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
5375
note: required by a bound in `pyo3::Bound::<'py, T>::borrow_mut`
5476
--> src/instance.rs
5577
|
@@ -58,13 +80,19 @@ note: required by a bound in `pyo3::Bound::<'py, T>::borrow_mut`
5880
| where
5981
| T: PyClass<Frozen = False>,
6082
| ^^^^^^^^^^^^^^ required by this bound in `Bound::<'py, T>::borrow_mut`
83+
= note: this error originates in the attribute macro `pyclass` (in Nightly builds, run with -Z macro-backtrace for more info)
6184

6285
error[E0271]: type mismatch resolving `<MutableBase as PyClass>::Frozen == True`
6386
--> tests/ui/invalid_frozen_pyclass_borrow.rs:29:11
6487
|
6588
29 | class.get();
66-
| ^^^ expected `True`, found `False`
89+
| ^^^ type mismatch resolving `<MutableBase as PyClass>::Frozen == True`
90+
|
91+
note: expected this to be `True`
92+
--> tests/ui/invalid_frozen_pyclass_borrow.rs:18:1
6793
|
94+
18 | #[pyclass(subclass)]
95+
| ^^^^^^^^^^^^^^^^^^^^
6896
note: required by a bound in `pyo3::Py::<T>::get`
6997
--> src/instance.rs
7098
|
@@ -73,13 +101,19 @@ note: required by a bound in `pyo3::Py::<T>::get`
73101
| where
74102
| T: PyClass<Frozen = True> + Sync,
75103
| ^^^^^^^^^^^^^ required by this bound in `Py::<T>::get`
104+
= note: this error originates in the attribute macro `pyclass` (in Nightly builds, run with -Z macro-backtrace for more info)
76105

77106
error[E0271]: type mismatch resolving `<MutableBase as PyClass>::Frozen == True`
78107
--> tests/ui/invalid_frozen_pyclass_borrow.rs:33:11
79108
|
80109
33 | class.get();
81-
| ^^^ expected `True`, found `False`
110+
| ^^^ type mismatch resolving `<MutableBase as PyClass>::Frozen == True`
111+
|
112+
note: expected this to be `True`
113+
--> tests/ui/invalid_frozen_pyclass_borrow.rs:18:1
82114
|
115+
18 | #[pyclass(subclass)]
116+
| ^^^^^^^^^^^^^^^^^^^^
83117
note: required by a bound in `pyo3::Bound::<'py, T>::get`
84118
--> src/instance.rs
85119
|
@@ -88,3 +122,4 @@ note: required by a bound in `pyo3::Bound::<'py, T>::get`
88122
| where
89123
| T: PyClass<Frozen = True> + Sync,
90124
| ^^^^^^^^^^^^^ required by this bound in `Bound::<'py, T>::get`
125+
= note: this error originates in the attribute macro `pyclass` (in Nightly builds, run with -Z macro-backtrace for more info)

tests/ui/invalid_pymethod_enum.stderr

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,48 +2,70 @@ error[E0271]: type mismatch resolving `<ComplexEnum as PyClass>::Frozen == False
22
--> tests/ui/invalid_pymethod_enum.rs:11:24
33
|
44
11 | fn mutate_in_place(&mut self) {
5-
| ^ expected `False`, found `True`
5+
| ^ type mismatch resolving `<ComplexEnum as PyClass>::Frozen == False`
66
|
7+
note: expected this to be `False`
8+
--> tests/ui/invalid_pymethod_enum.rs:3:1
9+
|
10+
3 | #[pyclass]
11+
| ^^^^^^^^^^
712
note: required by a bound in `extract_pyclass_ref_mut`
813
--> src/impl_/extract_argument.rs
914
|
1015
| pub fn extract_pyclass_ref_mut<'a, 'py: 'a, T: PyClass<Frozen = False>>(
1116
| ^^^^^^^^^^^^^^ required by this bound in `extract_pyclass_ref_mut`
17+
= note: this error originates in the attribute macro `pyclass` (in Nightly builds, run with -Z macro-backtrace for more info)
1218

1319
error[E0271]: type mismatch resolving `<ComplexEnum as PyClass>::Frozen == False`
1420
--> tests/ui/invalid_pymethod_enum.rs:9:1
1521
|
1622
9 | #[pymethods]
17-
| ^^^^^^^^^^^^ expected `False`, found `True`
23+
| ^^^^^^^^^^^^ type mismatch resolving `<ComplexEnum as PyClass>::Frozen == False`
24+
|
25+
note: expected this to be `False`
26+
--> tests/ui/invalid_pymethod_enum.rs:3:1
1827
|
28+
3 | #[pyclass]
29+
| ^^^^^^^^^^
1930
note: required by a bound in `PyRefMut`
2031
--> src/pycell.rs
2132
|
2233
| pub struct PyRefMut<'p, T: PyClass<Frozen = False>> {
2334
| ^^^^^^^^^^^^^^ required by this bound in `PyRefMut`
24-
= note: this error originates in the attribute macro `pymethods` (in Nightly builds, run with -Z macro-backtrace for more info)
35+
= note: this error originates in the attribute macro `pymethods` which comes from the expansion of the attribute macro `pyclass` (in Nightly builds, run with -Z macro-backtrace for more info)
2536

2637
error[E0271]: type mismatch resolving `<TupleEnum as PyClass>::Frozen == False`
2738
--> tests/ui/invalid_pymethod_enum.rs:27:24
2839
|
2940
27 | fn mutate_in_place(&mut self) {
30-
| ^ expected `False`, found `True`
41+
| ^ type mismatch resolving `<TupleEnum as PyClass>::Frozen == False`
3142
|
43+
note: expected this to be `False`
44+
--> tests/ui/invalid_pymethod_enum.rs:19:1
45+
|
46+
19 | #[pyclass]
47+
| ^^^^^^^^^^
3248
note: required by a bound in `extract_pyclass_ref_mut`
3349
--> src/impl_/extract_argument.rs
3450
|
3551
| pub fn extract_pyclass_ref_mut<'a, 'py: 'a, T: PyClass<Frozen = False>>(
3652
| ^^^^^^^^^^^^^^ required by this bound in `extract_pyclass_ref_mut`
53+
= note: this error originates in the attribute macro `pyclass` (in Nightly builds, run with -Z macro-backtrace for more info)
3754

3855
error[E0271]: type mismatch resolving `<TupleEnum as PyClass>::Frozen == False`
3956
--> tests/ui/invalid_pymethod_enum.rs:25:1
4057
|
4158
25 | #[pymethods]
42-
| ^^^^^^^^^^^^ expected `False`, found `True`
59+
| ^^^^^^^^^^^^ type mismatch resolving `<TupleEnum as PyClass>::Frozen == False`
60+
|
61+
note: expected this to be `False`
62+
--> tests/ui/invalid_pymethod_enum.rs:19:1
4363
|
64+
19 | #[pyclass]
65+
| ^^^^^^^^^^
4466
note: required by a bound in `PyRefMut`
4567
--> src/pycell.rs
4668
|
4769
| pub struct PyRefMut<'p, T: PyClass<Frozen = False>> {
4870
| ^^^^^^^^^^^^^^ required by this bound in `PyRefMut`
49-
= note: this error originates in the attribute macro `pymethods` (in Nightly builds, run with -Z macro-backtrace for more info)
71+
= note: this error originates in the attribute macro `pymethods` which comes from the expansion of the attribute macro `pyclass` (in Nightly builds, run with -Z macro-backtrace for more info)

tests/ui/static_ref.stderr

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,30 +11,18 @@ error[E0521]: borrowed data escapes outside of function
1111
|
1212
= note: this error originates in the attribute macro `pyfunction` (in Nightly builds, run with -Z macro-backtrace for more info)
1313

14-
error[E0597]: `output[_]` does not live long enough
14+
error[E0716]: temporary value dropped while borrowed
1515
--> tests/ui/static_ref.rs:4:1
1616
|
1717
4 | #[pyfunction]
1818
| ^^^^^^^^^^^^-
1919
| | |
20-
| | `output[_]` dropped here while still borrowed
21-
| borrowed value does not live long enough
22-
| argument requires that `output[_]` is borrowed for `'static`
20+
| | temporary value is freed at the end of this statement
21+
| creates a temporary value which is freed while still in use
22+
| argument requires that borrow lasts for `'static`
2323
|
2424
= note: this error originates in the attribute macro `pyfunction` (in Nightly builds, run with -Z macro-backtrace for more info)
2525

26-
error[E0597]: `holder_0` does not live long enough
27-
--> tests/ui/static_ref.rs:5:15
28-
|
29-
4 | #[pyfunction]
30-
| -------------
31-
| | |
32-
| | `holder_0` dropped here while still borrowed
33-
| binding `holder_0` declared here
34-
| argument requires that `holder_0` is borrowed for `'static`
35-
5 | fn static_ref(list: &'static Bound<'_, PyList>) -> usize {
36-
| ^^^^^^^ borrowed value does not live long enough
37-
3826
error[E0521]: borrowed data escapes outside of function
3927
--> tests/ui/static_ref.rs:9:1
4028
|

0 commit comments

Comments
 (0)