diff --git a/tests/test_compile_error.rs b/tests/test_compile_error.rs index 142750d8..f61d72ec 100644 --- a/tests/test_compile_error.rs +++ b/tests/test_compile_error.rs @@ -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) {} } diff --git a/tests/ui/invalid_pymethod_receiver.stderr b/tests/ui/invalid_pymethod_receiver.stderr index 8ae6a4cd..044678b2 100644 --- a/tests/ui/invalid_pymethod_receiver.stderr +++ b/tests/ui/invalid_pymethod_receiver.stderr @@ -1,8 +1,8 @@ -error[E0277]: the trait bound `i32: std::convert::From<&pyo3::pycell::PyCell>` is not satisfied +error[E0277]: the trait bound `i32: std::convert::From<&pyo3::PyCell>` 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>` is not implemented for `i32` + | ^^^ the trait `std::convert::From<&pyo3::PyCell>` is not implemented for `i32` | = help: the following implementations were found: > @@ -10,5 +10,5 @@ error[E0277]: the trait bound `i32: std::convert::From<&pyo3::pycell::PyCell> > and 2 others - = note: required because of the requirements on the impl of `std::convert::Into` for `&pyo3::pycell::PyCell` - = note: required because of the requirements on the impl of `std::convert::TryFrom<&pyo3::pycell::PyCell>` for `i32` + = note: required because of the requirements on the impl of `std::convert::Into` for `&pyo3::PyCell` + = note: required because of the requirements on the impl of `std::convert::TryFrom<&pyo3::PyCell>` for `i32` diff --git a/tests/ui/invalid_result_conversion.stderr b/tests/ui/invalid_result_conversion.stderr index fc92ebf6..a7e8a6d0 100644 --- a/tests/ui/invalid_result_conversion.stderr +++ b/tests/ui/invalid_result_conversion.stderr @@ -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, +170 | T: IntoPyCallbackOutput, | ----------------------- required by this bound in `pyo3::callback::convert` | = help: the following implementations were found: diff --git a/tests/ui/missing_clone.stderr b/tests/ui/missing_clone.stderr index bb243766..e828edc8 100644 --- a/tests/ui/missing_clone.stderr +++ b/tests/ui/missing_clone.stderr @@ -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`