diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7047a6a4..647ef9c0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -152,6 +152,8 @@ jobs: target: ${{ matrix.platform.rust-target }} profile: minimal default: true + # needed to correctly format errors, see #1865 + components: rust-src - if: matrix.platform.os == 'ubuntu-latest' name: Prepare LD_LIBRARY_PATH (Ubuntu only) diff --git a/tests/test_compile_error.rs b/tests/test_compile_error.rs index 098ea6bb..d534b006 100644 --- a/tests/test_compile_error.rs +++ b/tests/test_compile_error.rs @@ -28,6 +28,7 @@ fn _test_compile_errors() { tests_rust_1_48(&t); tests_rust_1_49(&t); tests_rust_1_54(&t); + tests_rust_1_55(&t); #[rustversion::since(1.48)] fn tests_rust_1_48(t: &trybuild::TestCases) { @@ -40,7 +41,6 @@ fn _test_compile_errors() { #[rustversion::since(1.49)] fn tests_rust_1_49(t: &trybuild::TestCases) { t.compile_fail("tests/ui/deprecations.rs"); - t.compile_fail("tests/ui/invalid_pymethod_receiver.rs"); } #[rustversion::before(1.49)] fn tests_rust_1_49(_t: &trybuild::TestCases) {} @@ -51,10 +51,18 @@ fn _test_compile_errors() { t.compile_fail("tests/ui/invalid_result_conversion.rs"); t.compile_fail("tests/ui/pyclass_send.rs"); t.compile_fail("tests/ui/static_ref.rs"); + } + #[rustversion::before(1.54)] + fn tests_rust_1_54(_t: &trybuild::TestCases) {} + + #[rustversion::before(1.55)] + fn tests_rust_1_55(_t: &trybuild::TestCases) {} + + #[rustversion::since(1.55)] + fn tests_rust_1_55(t: &trybuild::TestCases) { + t.compile_fail("tests/ui/invalid_pymethod_receiver.rs"); #[cfg(Py_LIMITED_API)] t.compile_fail("tests/ui/abi3_nativetype_inheritance.rs"); } - #[rustversion::before(1.54)] - fn tests_rust_1_54(_t: &trybuild::TestCases) {} } diff --git a/tests/ui/abi3_nativetype_inheritance.stderr b/tests/ui/abi3_nativetype_inheritance.stderr index b0756c69..f7c72666 100644 --- a/tests/ui/abi3_nativetype_inheritance.stderr +++ b/tests/ui/abi3_nativetype_inheritance.stderr @@ -1,11 +1,16 @@ error[E0277]: the trait bound `PyDict: PyClass` is not satisfied - --> $DIR/abi3_nativetype_inheritance.rs:5:1 - | -5 | #[pyclass(extends=PyDict)] - | ^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `PyClass` is not implemented for `PyDict` - | - = note: required because of the requirements on the impl of `PyClassBaseType` for `PyDict` - = note: this error originates in the attribute macro `pyclass` (in Nightly builds, run with -Z macro-backtrace for more info) + --> $DIR/abi3_nativetype_inheritance.rs:5:1 + | +5 | #[pyclass(extends=PyDict)] + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `PyClass` is not implemented for `PyDict` + | + ::: $WORKSPACE/src/class/impl_.rs + | + | pub trait PyClassBaseType: Sized { + | -------------------------------- required by this bound in `PyClassBaseType` + | + = note: required because of the requirements on the impl of `PyClassBaseType` for `PyDict` + = note: this error originates in the attribute macro `pyclass` (in Nightly builds, run with -Z macro-backtrace for more info) error[E0277]: the trait bound `PyDict: PyClass` is not satisfied --> $DIR/abi3_nativetype_inheritance.rs:5:1 diff --git a/tests/ui/invalid_pymethod_receiver.stderr b/tests/ui/invalid_pymethod_receiver.stderr index d6dc0ac6..b481fa1e 100644 --- a/tests/ui/invalid_pymethod_receiver.stderr +++ b/tests/ui/invalid_pymethod_receiver.stderr @@ -1,15 +1,19 @@ error[E0277]: the trait bound `i32: From<&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 `From<&PyCell>` is not implemented for `i32` - | - = help: the following implementations were found: - > - > - > - > - and 2 others - = note: required because of the requirements on the impl of `Into` for `&PyCell` - = note: required because of the requirements on the impl of `TryFrom<&PyCell>` for `i32` - = note: required by `std::convert::TryFrom::try_from` + --> $DIR/invalid_pymethod_receiver.rs:8:43 + | +8 | fn method_with_invalid_self_type(slf: i32, py: Python, index: u32) {} + | ^^^ the trait `From<&PyCell>` is not implemented for `i32` + | + = help: the following implementations were found: + > + > + > + > + and 2 others + = note: required because of the requirements on the impl of `Into` for `&PyCell` + = note: required because of the requirements on the impl of `TryFrom<&PyCell>` for `i32` +note: required by `std::convert::TryFrom::try_from` + --> $DIR/mod.rs:477:5 + | +477 | fn try_from(value: T) -> Result; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^