diff --git a/Cargo.toml b/Cargo.toml index 99d094b447a..331e5acd8e7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -43,6 +43,8 @@ serde = { version = "1.0", optional = true } assert_approx_eq = "1.1.0" # O.3.5 uses the matches! macro, which isn't compatible with Rust 1.41 criterion = "=0.3.4" +# 2.34 uses the matches! macro, which isn't compatible with Rust 1.41 +clap = "=2.33" # half and bitflags use if/match in const fn, which isn't compatible with Rust 1.41 half = "=1.7.1" bitflags = "=1.2.1" diff --git a/tests/test_compile_error.rs b/tests/test_compile_error.rs index 4751f774d0e..87492944b3f 100644 --- a/tests/test_compile_error.rs +++ b/tests/test_compile_error.rs @@ -19,17 +19,14 @@ fn _test_compile_errors() { t.compile_fail("tests/ui/invalid_need_module_arg_position.rs"); t.compile_fail("tests/ui/invalid_property_args.rs"); t.compile_fail("tests/ui/invalid_pyclass_args.rs"); - t.compile_fail("tests/ui/invalid_pyfunctions.rs"); - t.compile_fail("tests/ui/invalid_pymethods.rs"); t.compile_fail("tests/ui/invalid_pymethod_names.rs"); - t.compile_fail("tests/ui/invalid_argument_attributes.rs"); t.compile_fail("tests/ui/reject_generics.rs"); tests_rust_1_48(&t); tests_rust_1_49(&t); tests_rust_1_54(&t); - tests_rust_1_55(&t); tests_rust_1_56(&t); + tests_rust_1_60(&t); #[rustversion::since(1.48)] fn tests_rust_1_48(t: &trybuild::TestCases) { @@ -48,20 +45,11 @@ fn _test_compile_errors() { #[rustversion::since(1.54)] fn tests_rust_1_54(t: &trybuild::TestCases) { - t.compile_fail("tests/ui/invalid_frompy_derive.rs"); t.compile_fail("tests/ui/static_ref.rs"); } #[rustversion::before(1.54)] fn tests_rust_1_54(_t: &trybuild::TestCases) {} - #[rustversion::since(1.55)] - fn tests_rust_1_55(t: &trybuild::TestCases) { - t.compile_fail("tests/ui/invalid_pymethod_receiver.rs"); - } - - #[rustversion::before(1.55)] - fn tests_rust_1_55(_t: &trybuild::TestCases) {} - #[rustversion::since(1.56)] fn tests_rust_1_56(t: &trybuild::TestCases) { t.compile_fail("tests/ui/invalid_closure.rs"); @@ -74,4 +62,15 @@ fn _test_compile_errors() { #[rustversion::before(1.56)] fn tests_rust_1_56(_t: &trybuild::TestCases) {} + + + #[rustversion::since(1.60)] + fn tests_rust_1_60(t: &trybuild::TestCases) { + t.compile_fail("tests/ui/invalid_pymethod_receiver.rs"); + t.compile_fail("tests/ui/invalid_argument_attributes.rs"); + t.compile_fail("tests/ui/invalid_frompy_derive.rs"); + } + + #[rustversion::before(1.60)] + fn tests_rust_1_60(_t: &trybuild::TestCases) {} } diff --git a/tests/ui/invalid_argument_attributes.stderr b/tests/ui/invalid_argument_attributes.stderr index dd830a3ec04..ed6479d5512 100644 --- a/tests/ui/invalid_argument_attributes.stderr +++ b/tests/ui/invalid_argument_attributes.stderr @@ -5,10 +5,10 @@ error: expected `from_py_with` | ^^^ error: expected `=` - --> tests/ui/invalid_argument_attributes.rs:7:32 + --> tests/ui/invalid_argument_attributes.rs:7:45 | 7 | fn from_py_with_no_value(#[pyo3(from_py_with)] param: String) {} - | ^^^^^^^^^^^^^^ + | ^ error: expected `from_py_with` --> tests/ui/invalid_argument_attributes.rs:10:31 diff --git a/tests/ui/invalid_frompy_derive.stderr b/tests/ui/invalid_frompy_derive.stderr index b5cb180dcee..d16c082f9f5 100644 --- a/tests/ui/invalid_frompy_derive.stderr +++ b/tests/ui/invalid_frompy_derive.stderr @@ -109,10 +109,10 @@ error: attribute name cannot be empty | ^^ error: unexpected end of input, expected string literal - --> tests/ui/invalid_frompy_derive.rs:100:21 + --> tests/ui/invalid_frompy_derive.rs:100:22 | 100 | #[pyo3(attribute())] - | ^^ + | ^ error: expected at most one argument: `item` or `item(key)` --> tests/ui/invalid_frompy_derive.rs:106:20 @@ -121,10 +121,10 @@ error: expected at most one argument: `item` or `item(key)` | ^ error: unexpected end of input, expected literal - --> tests/ui/invalid_frompy_derive.rs:112:16 + --> tests/ui/invalid_frompy_derive.rs:112:17 | 112 | #[pyo3(item())] - | ^^ + | ^ error: only one of `attribute` or `item` can be provided --> tests/ui/invalid_frompy_derive.rs:118:5 @@ -171,10 +171,10 @@ error: cannot derive FromPyObject for empty structs and variants = note: this error originates in the derive macro `FromPyObject` (in Nightly builds, run with -Z macro-backtrace for more info) error: expected `=` - --> tests/ui/invalid_frompy_derive.rs:158:11 + --> tests/ui/invalid_frompy_derive.rs:158:24 | 158 | #[pyo3(from_py_with)] - | ^^^^^^^^^^^^^^ + | ^ error: expected string literal --> tests/ui/invalid_frompy_derive.rs:164:27 diff --git a/tests/ui/invalid_pymethod_receiver.stderr b/tests/ui/invalid_pymethod_receiver.stderr index 09057ae71b4..fb3587f5e30 100644 --- a/tests/ui/invalid_pymethod_receiver.stderr +++ b/tests/ui/invalid_pymethod_receiver.stderr @@ -9,6 +9,6 @@ error[E0277]: the trait bound `i32: From<&PyCell>` is not satisfied > > > - and 2 others + and 71 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`