Skip to content

Commit 1f88c84

Browse files
committed
Bless ui test and pin clap
1 parent 54de029 commit 1f88c84

File tree

5 files changed

+23
-22
lines changed

5 files changed

+23
-22
lines changed

Cargo.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ serde = { version = "1.0", optional = true }
4343
assert_approx_eq = "1.1.0"
4444
# O.3.5 uses the matches! macro, which isn't compatible with Rust 1.41
4545
criterion = "=0.3.4"
46+
# 2.34 uses the matches! macro, which isn't compatible with Rust 1.41
47+
clap = "=2.33"
4648
# half and bitflags use if/match in const fn, which isn't compatible with Rust 1.41
4749
half = "=1.7.1"
4850
bitflags = "=1.2.1"

tests/test_compile_error.rs

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,17 +19,14 @@ fn _test_compile_errors() {
1919
t.compile_fail("tests/ui/invalid_need_module_arg_position.rs");
2020
t.compile_fail("tests/ui/invalid_property_args.rs");
2121
t.compile_fail("tests/ui/invalid_pyclass_args.rs");
22-
t.compile_fail("tests/ui/invalid_pyfunctions.rs");
23-
t.compile_fail("tests/ui/invalid_pymethods.rs");
2422
t.compile_fail("tests/ui/invalid_pymethod_names.rs");
25-
t.compile_fail("tests/ui/invalid_argument_attributes.rs");
2623
t.compile_fail("tests/ui/reject_generics.rs");
2724

2825
tests_rust_1_48(&t);
2926
tests_rust_1_49(&t);
3027
tests_rust_1_54(&t);
31-
tests_rust_1_55(&t);
3228
tests_rust_1_56(&t);
29+
tests_rust_1_60(&t);
3330

3431
#[rustversion::since(1.48)]
3532
fn tests_rust_1_48(t: &trybuild::TestCases) {
@@ -48,20 +45,11 @@ fn _test_compile_errors() {
4845

4946
#[rustversion::since(1.54)]
5047
fn tests_rust_1_54(t: &trybuild::TestCases) {
51-
t.compile_fail("tests/ui/invalid_frompy_derive.rs");
5248
t.compile_fail("tests/ui/static_ref.rs");
5349
}
5450
#[rustversion::before(1.54)]
5551
fn tests_rust_1_54(_t: &trybuild::TestCases) {}
5652

57-
#[rustversion::since(1.55)]
58-
fn tests_rust_1_55(t: &trybuild::TestCases) {
59-
t.compile_fail("tests/ui/invalid_pymethod_receiver.rs");
60-
}
61-
62-
#[rustversion::before(1.55)]
63-
fn tests_rust_1_55(_t: &trybuild::TestCases) {}
64-
6553
#[rustversion::since(1.56)]
6654
fn tests_rust_1_56(t: &trybuild::TestCases) {
6755
t.compile_fail("tests/ui/invalid_closure.rs");
@@ -74,4 +62,15 @@ fn _test_compile_errors() {
7462

7563
#[rustversion::before(1.56)]
7664
fn tests_rust_1_56(_t: &trybuild::TestCases) {}
65+
66+
67+
#[rustversion::since(1.60)]
68+
fn tests_rust_1_60(t: &trybuild::TestCases) {
69+
t.compile_fail("tests/ui/invalid_pymethod_receiver.rs");
70+
t.compile_fail("tests/ui/invalid_argument_attributes.rs");
71+
t.compile_fail("tests/ui/invalid_frompy_derive.rs");
72+
}
73+
74+
#[rustversion::before(1.60)]
75+
fn tests_rust_1_60(_t: &trybuild::TestCases) {}
7776
}

tests/ui/invalid_argument_attributes.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ error: expected `from_py_with`
55
| ^^^
66

77
error: expected `=`
8-
--> tests/ui/invalid_argument_attributes.rs:7:32
8+
--> tests/ui/invalid_argument_attributes.rs:7:45
99
|
1010
7 | fn from_py_with_no_value(#[pyo3(from_py_with)] param: String) {}
11-
| ^^^^^^^^^^^^^^
11+
| ^
1212

1313
error: expected `from_py_with`
1414
--> tests/ui/invalid_argument_attributes.rs:10:31

tests/ui/invalid_frompy_derive.stderr

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,10 @@ error: attribute name cannot be empty
109109
| ^^
110110

111111
error: unexpected end of input, expected string literal
112-
--> tests/ui/invalid_frompy_derive.rs:100:21
112+
--> tests/ui/invalid_frompy_derive.rs:100:22
113113
|
114114
100 | #[pyo3(attribute())]
115-
| ^^
115+
| ^
116116

117117
error: expected at most one argument: `item` or `item(key)`
118118
--> tests/ui/invalid_frompy_derive.rs:106:20
@@ -121,10 +121,10 @@ error: expected at most one argument: `item` or `item(key)`
121121
| ^
122122

123123
error: unexpected end of input, expected literal
124-
--> tests/ui/invalid_frompy_derive.rs:112:16
124+
--> tests/ui/invalid_frompy_derive.rs:112:17
125125
|
126126
112 | #[pyo3(item())]
127-
| ^^
127+
| ^
128128

129129
error: only one of `attribute` or `item` can be provided
130130
--> tests/ui/invalid_frompy_derive.rs:118:5
@@ -171,10 +171,10 @@ error: cannot derive FromPyObject for empty structs and variants
171171
= note: this error originates in the derive macro `FromPyObject` (in Nightly builds, run with -Z macro-backtrace for more info)
172172

173173
error: expected `=`
174-
--> tests/ui/invalid_frompy_derive.rs:158:11
174+
--> tests/ui/invalid_frompy_derive.rs:158:24
175175
|
176176
158 | #[pyo3(from_py_with)]
177-
| ^^^^^^^^^^^^^^
177+
| ^
178178

179179
error: expected string literal
180180
--> tests/ui/invalid_frompy_derive.rs:164:27

tests/ui/invalid_pymethod_receiver.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ error[E0277]: the trait bound `i32: From<&PyCell<MyClass>>` is not satisfied
99
<i32 as From<bool>>
1010
<i32 as From<i16>>
1111
<i32 as From<i8>>
12-
and 2 others
12+
and 71 others
1313
= note: required because of the requirements on the impl of `Into<i32>` for `&PyCell<MyClass>`
1414
= note: required because of the requirements on the impl of `TryFrom<&PyCell<MyClass>>` for `i32`

0 commit comments

Comments
 (0)