Skip to content

Commit 987e83b

Browse files
authored
Merge pull request #1121 from davidhewitt/update-ui-tests
Update UI tests for Rust 1.46
2 parents 608aea7 + 42296ea commit 987e83b

4 files changed

+20
-13
lines changed

tests/test_compile_error.rs

+13-6
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,25 @@ fn test_compile_errors() {
66
t.compile_fail("tests/ui/invalid_property_args.rs");
77
t.compile_fail("tests/ui/invalid_pyclass_args.rs");
88
t.compile_fail("tests/ui/invalid_pymethod_names.rs");
9-
t.compile_fail("tests/ui/invalid_pymethod_receiver.rs");
10-
t.compile_fail("tests/ui/missing_clone.rs");
119
t.compile_fail("tests/ui/reject_generics.rs");
1210
t.compile_fail("tests/ui/wrong_aspyref_lifetimes.rs");
13-
t.compile_fail("tests/ui/invalid_result_conversion.rs");
1411

15-
skip_min_stable(&t);
12+
tests_rust_1_43(&t);
13+
tests_rust_1_46(&t);
1614

1715
#[rustversion::since(1.43)]
18-
fn skip_min_stable(t: &trybuild::TestCases) {
16+
fn tests_rust_1_43(t: &trybuild::TestCases) {
1917
t.compile_fail("tests/ui/static_ref.rs");
2018
}
2119
#[rustversion::before(1.43)]
22-
fn skip_min_stable(_t: &trybuild::TestCases) {}
20+
fn tests_rust_1_43(_t: &trybuild::TestCases) {}
21+
22+
#[rustversion::since(1.46)]
23+
fn tests_rust_1_46(t: &trybuild::TestCases) {
24+
t.compile_fail("tests/ui/invalid_pymethod_receiver.rs");
25+
t.compile_fail("tests/ui/invalid_result_conversion.rs");
26+
t.compile_fail("tests/ui/missing_clone.rs");
27+
}
28+
#[rustversion::before(1.46)]
29+
fn tests_rust_1_46(_t: &trybuild::TestCases) {}
2330
}
+4-4
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
error[E0277]: the trait bound `i32: std::convert::From<&pyo3::pycell::PyCell<MyClass>>` is not satisfied
1+
error[E0277]: the trait bound `i32: std::convert::From<&pyo3::PyCell<MyClass>>` is not satisfied
22
--> $DIR/invalid_pymethod_receiver.rs:8:43
33
|
44
8 | fn method_with_invalid_self_type(slf: i32, py: Python, index: u32) {}
5-
| ^^^ the trait `std::convert::From<&pyo3::pycell::PyCell<MyClass>>` is not implemented for `i32`
5+
| ^^^ the trait `std::convert::From<&pyo3::PyCell<MyClass>>` is not implemented for `i32`
66
|
77
= help: the following implementations were found:
88
<i32 as std::convert::From<bool>>
99
<i32 as std::convert::From<i16>>
1010
<i32 as std::convert::From<i8>>
1111
<i32 as std::convert::From<std::num::NonZeroI32>>
1212
and 2 others
13-
= note: required because of the requirements on the impl of `std::convert::Into<i32>` for `&pyo3::pycell::PyCell<MyClass>`
14-
= note: required because of the requirements on the impl of `std::convert::TryFrom<&pyo3::pycell::PyCell<MyClass>>` for `i32`
13+
= note: required because of the requirements on the impl of `std::convert::Into<i32>` for `&pyo3::PyCell<MyClass>`
14+
= note: required because of the requirements on the impl of `std::convert::TryFrom<&pyo3::PyCell<MyClass>>` for `i32`

tests/ui/invalid_result_conversion.stderr

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ error[E0277]: the trait bound `std::result::Result<(), MyError>: pyo3::callback:
44
22 | #[pyfunction]
55
| ^^^^^^^^^^^^^ the trait `pyo3::callback::IntoPyCallbackOutput<_>` is not implemented for `std::result::Result<(), MyError>`
66
|
7-
::: $WORKSPACE/src/callback.rs
7+
::: $WORKSPACE/src/callback.rs:170:8
88
|
9-
| T: IntoPyCallbackOutput<U>,
9+
170 | T: IntoPyCallbackOutput<U>,
1010
| ----------------------- required by this bound in `pyo3::callback::convert`
1111
|
1212
= help: the following implementations were found:

tests/ui/missing_clone.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ error[E0277]: the trait bound `TestClass: std::clone::Clone` is not satisfied
44
15 | let t: TestClass = pyvalue.extract(py).unwrap();
55
| ^^^^^^^ the trait `std::clone::Clone` is not implemented for `TestClass`
66
|
7-
= note: required because of the requirements on the impl of `pyo3::conversion::FromPyObject<'_>` for `TestClass`
7+
= note: required because of the requirements on the impl of `pyo3::FromPyObject<'_>` for `TestClass`

0 commit comments

Comments
 (0)