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" ) ;
@@ -45,91 +18,24 @@ fn _test_compile_errors() {
45
18
t. compile_fail ( "tests/ui/invalid_pymethod_names.rs" ) ;
46
19
t. compile_fail ( "tests/ui/invalid_pymodule_args.rs" ) ;
47
20
t. compile_fail ( "tests/ui/reject_generics.rs" ) ;
48
-
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) ;
56
-
57
- #[ rustversion:: since( 1.49 ) ]
58
- fn tests_rust_1_49 ( t : & trybuild:: TestCases ) {
59
- 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
- t. compile_fail ( "tests/ui/invalid_closure.rs" ) ;
67
-
68
- 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
- t. compile_fail ( "tests/ui/invalid_argument_attributes.rs" ) ;
77
- t. compile_fail ( "tests/ui/invalid_frompy_derive.rs" ) ;
78
- t. compile_fail ( "tests/ui/static_ref.rs" ) ;
79
- 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
- t. compile_fail ( "tests/ui/invalid_pyfunctions.rs" ) ;
88
- t. compile_fail ( "tests/ui/invalid_pymethods.rs" ) ;
89
- #[ cfg( Py_LIMITED_API ) ]
90
- 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
- t. compile_fail ( "tests/ui/invalid_intern_arg.rs" ) ;
99
- 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
- t. compile_fail ( "tests/ui/invalid_pymethod_receiver.rs" ) ;
108
- 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
- t. compile_fail ( "tests/ui/invalid_result_conversion.rs" ) ;
117
- t. compile_fail ( "tests/ui/not_send.rs" ) ;
118
- t. compile_fail ( "tests/ui/not_send2.rs" ) ;
119
- t. compile_fail ( "tests/ui/not_send3.rs" ) ;
120
- t. compile_fail ( "tests/ui/get_set_all.rs" ) ;
121
- t. compile_fail ( "tests/ui/traverse_bare_self.rs" ) ;
122
- }
123
-
124
- #[ rustversion:: before( 1.63 ) ]
125
- fn tests_rust_1_63 ( _t : & trybuild:: TestCases ) { }
126
- }
127
-
128
- #[ cfg( feature = "nightly" ) ]
129
- fn _test_compile_errors ( ) {
130
- let t = trybuild:: TestCases :: new ( ) ;
131
-
132
- t. compile_fail ( "tests/ui/not_send_auto_trait.rs" ) ;
133
- t. compile_fail ( "tests/ui/not_send_auto_trait2.rs" ) ;
134
- t. compile_fail ( "tests/ui/send_wrapper.rs" ) ;
21
+ t. compile_fail ( "tests/ui/deprecations.rs" ) ;
22
+ t. compile_fail ( "tests/ui/invalid_closure.rs" ) ;
23
+ t. compile_fail ( "tests/ui/pyclass_send.rs" ) ;
24
+ t. compile_fail ( "tests/ui/invalid_argument_attributes.rs" ) ;
25
+ t. compile_fail ( "tests/ui/invalid_frompy_derive.rs" ) ;
26
+ t. compile_fail ( "tests/ui/static_ref.rs" ) ;
27
+ t. compile_fail ( "tests/ui/wrong_aspyref_lifetimes.rs" ) ;
28
+ t. compile_fail ( "tests/ui/invalid_pyfunctions.rs" ) ;
29
+ t. compile_fail ( "tests/ui/invalid_pymethods.rs" ) ;
30
+ #[ cfg( Py_LIMITED_API ) ]
31
+ t. compile_fail ( "tests/ui/abi3_nativetype_inheritance.rs" ) ;
32
+ t. compile_fail ( "tests/ui/invalid_intern_arg.rs" ) ;
33
+ t. compile_fail ( "tests/ui/invalid_frozen_pyclass_borrow.rs" ) ;
34
+ t. compile_fail ( "tests/ui/invalid_pymethod_receiver.rs" ) ;
35
+ t. compile_fail ( "tests/ui/missing_intopy.rs" ) ;
36
+ t. compile_fail ( "tests/ui/invalid_result_conversion.rs" ) ;
37
+ t. compile_fail ( "tests/ui/not_send.rs" ) ;
38
+ t. compile_fail ( "tests/ui/not_send2.rs" ) ;
39
+ t. compile_fail ( "tests/ui/get_set_all.rs" ) ;
40
+ t. compile_fail ( "tests/ui/traverse_bare_self.rs" ) ;
135
41
}
0 commit comments