1
1
#![ cfg( feature = "macros" ) ]
2
2
3
- #[ rustversion:: not( nightly) ]
4
3
#[ cfg( not( target_arch = "wasm32" ) ) ] // Not possible to invoke compiler from wasm
5
4
#[ test]
6
5
fn test_compile_errors ( ) {
7
- // stable - require all tests to pass
8
- _test_compile_errors ( )
9
- }
10
-
11
- #[ cfg( not( feature = "nightly" ) ) ]
12
- #[ cfg( not( target_arch = "wasm32" ) ) ] // We are building wasm Python with pthreads disabled
13
- #[ rustversion:: nightly]
14
- #[ test]
15
- fn test_compile_errors ( ) {
16
- // nightly - don't care if test output is potentially wrong, to avoid churn in PyO3's CI thanks
17
- // to diagnostics changing on nightly.
18
- let _ = std:: panic:: catch_unwind ( _test_compile_errors) ;
19
- }
20
-
21
- #[ cfg( feature = "nightly" ) ]
22
- #[ cfg( not( target_arch = "wasm32" ) ) ] // Not possible to invoke compiler from wasm
23
- #[ rustversion:: nightly]
24
- #[ test]
25
- fn test_compile_errors ( ) {
26
- // nightly - don't care if test output is potentially wrong, to avoid churn in PyO3's CI thanks
27
- // to diagnostics changing on nightly.
28
- _test_compile_errors ( )
29
- }
30
-
31
- #[ cfg( not( feature = "nightly" ) ) ]
32
- fn _test_compile_errors ( ) {
33
6
let t = trybuild:: TestCases :: new ( ) ;
34
7
35
8
t. compile_fail ( "tests/ui/invalid_macro_args.rs" ) ;
@@ -46,89 +19,44 @@ fn _test_compile_errors() {
46
19
t. compile_fail ( "tests/ui/invalid_pymodule_args.rs" ) ;
47
20
t. compile_fail ( "tests/ui/reject_generics.rs" ) ;
48
21
49
- tests_rust_1_49 ( & t) ;
50
- tests_rust_1_56 ( & t) ;
51
- tests_rust_1_57 ( & t) ;
52
- tests_rust_1_58 ( & t) ;
53
- tests_rust_1_60 ( & t) ;
54
- tests_rust_1_62 ( & t) ;
55
- tests_rust_1_63 ( & t) ;
22
+ tests_not_msrv ( & t) ;
23
+ tests_nightly ( & t) ;
56
24
57
25
#[ rustversion:: since( 1.49 ) ]
58
- fn tests_rust_1_49 ( t : & trybuild:: TestCases ) {
26
+ fn tests_not_msrv ( t : & trybuild:: TestCases ) {
59
27
t. compile_fail ( "tests/ui/deprecations.rs" ) ;
60
- }
61
- #[ rustversion:: before( 1.49 ) ]
62
- fn tests_rust_1_49 ( _t : & trybuild:: TestCases ) { }
63
-
64
- #[ rustversion:: since( 1.56 ) ]
65
- fn tests_rust_1_56 ( t : & trybuild:: TestCases ) {
66
28
t. compile_fail ( "tests/ui/invalid_closure.rs" ) ;
67
-
68
29
t. compile_fail ( "tests/ui/pyclass_send.rs" ) ;
69
- }
70
-
71
- #[ rustversion:: before( 1.56 ) ]
72
- fn tests_rust_1_56 ( _t : & trybuild:: TestCases ) { }
73
-
74
- #[ rustversion:: since( 1.57 ) ]
75
- fn tests_rust_1_57 ( t : & trybuild:: TestCases ) {
76
30
t. compile_fail ( "tests/ui/invalid_argument_attributes.rs" ) ;
77
31
t. compile_fail ( "tests/ui/invalid_frompy_derive.rs" ) ;
78
32
t. compile_fail ( "tests/ui/static_ref.rs" ) ;
79
33
t. compile_fail ( "tests/ui/wrong_aspyref_lifetimes.rs" ) ;
80
- }
81
-
82
- #[ rustversion:: before( 1.57 ) ]
83
- fn tests_rust_1_57 ( _t : & trybuild:: TestCases ) { }
84
-
85
- #[ rustversion:: since( 1.58 ) ]
86
- fn tests_rust_1_58 ( t : & trybuild:: TestCases ) {
87
34
t. compile_fail ( "tests/ui/invalid_pyfunctions.rs" ) ;
88
35
t. compile_fail ( "tests/ui/invalid_pymethods.rs" ) ;
89
36
#[ cfg( Py_LIMITED_API ) ]
90
37
t. compile_fail ( "tests/ui/abi3_nativetype_inheritance.rs" ) ;
91
- }
92
-
93
- #[ rustversion:: before( 1.58 ) ]
94
- fn tests_rust_1_58 ( _t : & trybuild:: TestCases ) { }
95
-
96
- #[ rustversion:: since( 1.60 ) ]
97
- fn tests_rust_1_60 ( t : & trybuild:: TestCases ) {
98
38
t. compile_fail ( "tests/ui/invalid_intern_arg.rs" ) ;
99
39
t. compile_fail ( "tests/ui/invalid_frozen_pyclass_borrow.rs" ) ;
100
- }
101
-
102
- #[ rustversion:: before( 1.60 ) ]
103
- fn tests_rust_1_60 ( _t : & trybuild:: TestCases ) { }
104
-
105
- #[ rustversion:: since( 1.62 ) ]
106
- fn tests_rust_1_62 ( t : & trybuild:: TestCases ) {
107
40
t. compile_fail ( "tests/ui/invalid_pymethod_receiver.rs" ) ;
108
41
t. compile_fail ( "tests/ui/missing_intopy.rs" ) ;
109
- }
110
-
111
- #[ rustversion:: before( 1.62 ) ]
112
- fn tests_rust_1_62 ( _t : & trybuild:: TestCases ) { }
113
-
114
- #[ rustversion:: since( 1.63 ) ]
115
- fn tests_rust_1_63 ( t : & trybuild:: TestCases ) {
116
42
t. compile_fail ( "tests/ui/invalid_result_conversion.rs" ) ;
117
43
t. compile_fail ( "tests/ui/not_send.rs" ) ;
118
44
t. compile_fail ( "tests/ui/not_send2.rs" ) ;
45
+ #[ cfg( not( feature = "nightly" ) ) ]
119
46
t. compile_fail ( "tests/ui/not_send3.rs" ) ;
120
47
t. compile_fail ( "tests/ui/get_set_all.rs" ) ;
121
48
}
122
49
123
- #[ rustversion:: before( 1.63 ) ]
124
- fn tests_rust_1_63 ( _t : & trybuild:: TestCases ) { }
125
- }
50
+ #[ rustversion:: before( 1.49 ) ]
51
+ fn tests_not_msrv ( _t : & trybuild:: TestCases ) { }
126
52
127
- #[ cfg( feature = "nightly" ) ]
128
- fn _test_compile_errors ( ) {
129
- let t = trybuild:: TestCases :: new ( ) ;
53
+ #[ cfg( feature = "nightly" ) ]
54
+ fn tests_nightly ( t : & trybuild:: TestCases ) {
55
+ t. compile_fail ( "tests/ui/not_send_auto_trait.rs" ) ;
56
+ t. compile_fail ( "tests/ui/not_send_auto_trait2.rs" ) ;
57
+ t. compile_fail ( "tests/ui/send_wrapper.rs" ) ;
58
+ }
130
59
131
- t. compile_fail ( "tests/ui/not_send_auto_trait.rs" ) ;
132
- t. compile_fail ( "tests/ui/not_send_auto_trait2.rs" ) ;
133
- t. compile_fail ( "tests/ui/send_wrapper.rs" ) ;
60
+ #[ cfg( not( feature = "nightly" ) ) ]
61
+ fn tests_nightly ( _t : & trybuild:: TestCases ) { }
134
62
}
0 commit comments