Update UI tests for Rust 1.46

This commit is contained in:
David Hewitt 2020-08-28 03:29:38 +01:00
parent 608aea726c
commit 42296ea5c2
4 changed files with 20 additions and 13 deletions

View File

@ -6,18 +6,25 @@ fn test_compile_errors() {
t.compile_fail("tests/ui/invalid_property_args.rs");
t.compile_fail("tests/ui/invalid_pyclass_args.rs");
t.compile_fail("tests/ui/invalid_pymethod_names.rs");
t.compile_fail("tests/ui/invalid_pymethod_receiver.rs");
t.compile_fail("tests/ui/missing_clone.rs");
t.compile_fail("tests/ui/reject_generics.rs");
t.compile_fail("tests/ui/wrong_aspyref_lifetimes.rs");
t.compile_fail("tests/ui/invalid_result_conversion.rs");
skip_min_stable(&t);
tests_rust_1_43(&t);
tests_rust_1_46(&t);
#[rustversion::since(1.43)]
fn skip_min_stable(t: &trybuild::TestCases) {
fn tests_rust_1_43(t: &trybuild::TestCases) {
t.compile_fail("tests/ui/static_ref.rs");
}
#[rustversion::before(1.43)]
fn skip_min_stable(_t: &trybuild::TestCases) {}
fn tests_rust_1_43(_t: &trybuild::TestCases) {}
#[rustversion::since(1.46)]
fn tests_rust_1_46(t: &trybuild::TestCases) {
t.compile_fail("tests/ui/invalid_pymethod_receiver.rs");
t.compile_fail("tests/ui/invalid_result_conversion.rs");
t.compile_fail("tests/ui/missing_clone.rs");
}
#[rustversion::before(1.46)]
fn tests_rust_1_46(_t: &trybuild::TestCases) {}
}

View File

@ -1,8 +1,8 @@
error[E0277]: the trait bound `i32: std::convert::From<&pyo3::pycell::PyCell<MyClass>>` is not satisfied
error[E0277]: the trait bound `i32: std::convert::From<&pyo3::PyCell<MyClass>>` is not satisfied
--> $DIR/invalid_pymethod_receiver.rs:8:43
|
8 | fn method_with_invalid_self_type(slf: i32, py: Python, index: u32) {}
| ^^^ the trait `std::convert::From<&pyo3::pycell::PyCell<MyClass>>` is not implemented for `i32`
| ^^^ the trait `std::convert::From<&pyo3::PyCell<MyClass>>` is not implemented for `i32`
|
= help: the following implementations were found:
<i32 as std::convert::From<bool>>
@ -10,5 +10,5 @@ error[E0277]: the trait bound `i32: std::convert::From<&pyo3::pycell::PyCell<MyC
<i32 as std::convert::From<i8>>
<i32 as std::convert::From<std::num::NonZeroI32>>
and 2 others
= note: required because of the requirements on the impl of `std::convert::Into<i32>` for `&pyo3::pycell::PyCell<MyClass>`
= note: required because of the requirements on the impl of `std::convert::TryFrom<&pyo3::pycell::PyCell<MyClass>>` for `i32`
= note: required because of the requirements on the impl of `std::convert::Into<i32>` for `&pyo3::PyCell<MyClass>`
= note: required because of the requirements on the impl of `std::convert::TryFrom<&pyo3::PyCell<MyClass>>` for `i32`

View File

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

View File

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