@@ -2,11 +2,10 @@ error: the `#[test]` attribute may only be used on a non-associated function
2
2
--> $DIR/test-on-not-fn.rs:3:1
3
3
|
4
4
LL | #[test]
5
- | ^^^^^^^
5
+ | ^^^^^^^ the `#[test]` macro causes a a function to be run on a test and has no effect on non-functions
6
6
LL | mod test {}
7
7
| ----------- expected a non-associated function, found a module
8
8
|
9
- = note: the `#[test]` macro causes a a function to be run on a test and has no effect on non-functions
10
9
help: replace with conditional compilation to make the item only exist when tests are being run
11
10
|
12
11
LL | #[cfg(test)]
@@ -16,7 +15,7 @@ error: the `#[test]` attribute may only be used on a non-associated function
16
15
--> $DIR/test-on-not-fn.rs:6:1
17
16
|
18
17
LL | #[test]
19
- | ^^^^^^^
18
+ | ^^^^^^^ the `#[test]` macro causes a a function to be run on a test and has no effect on non-functions
20
19
LL | / mod loooooooooooooong_teeeeeeeeeest {
21
20
LL | | /*
22
21
LL | | this is a comment
@@ -26,7 +25,6 @@ LL | | */
26
25
LL | | }
27
26
| |_- expected a non-associated function, found a module
28
27
|
29
- = note: the `#[test]` macro causes a a function to be run on a test and has no effect on non-functions
30
28
help: replace with conditional compilation to make the item only exist when tests are being run
31
29
|
32
30
LL | #[cfg(test)]
@@ -36,11 +34,10 @@ error: the `#[test]` attribute may only be used on a non-associated function
36
34
--> $DIR/test-on-not-fn.rs:20:1
37
35
|
38
36
LL | #[test]
39
- | ^^^^^^^
37
+ | ^^^^^^^ the `#[test]` macro causes a a function to be run on a test and has no effect on non-functions
40
38
LL | extern "C" {}
41
39
| ------------- expected a non-associated function, found an extern block
42
40
|
43
- = note: the `#[test]` macro causes a a function to be run on a test and has no effect on non-functions
44
41
help: replace with conditional compilation to make the item only exist when tests are being run
45
42
|
46
43
LL | #[cfg(test)]
@@ -50,11 +47,10 @@ error: the `#[test]` attribute may only be used on a non-associated function
50
47
--> $DIR/test-on-not-fn.rs:23:1
51
48
|
52
49
LL | #[test]
53
- | ^^^^^^^
50
+ | ^^^^^^^ the `#[test]` macro causes a a function to be run on a test and has no effect on non-functions
54
51
LL | trait Foo {}
55
52
| ------------ expected a non-associated function, found a trait
56
53
|
57
- = note: the `#[test]` macro causes a a function to be run on a test and has no effect on non-functions
58
54
help: replace with conditional compilation to make the item only exist when tests are being run
59
55
|
60
56
LL | #[cfg(test)]
@@ -64,11 +60,10 @@ error: the `#[test]` attribute may only be used on a non-associated function
64
60
--> $DIR/test-on-not-fn.rs:26:1
65
61
|
66
62
LL | #[test]
67
- | ^^^^^^^
63
+ | ^^^^^^^ the `#[test]` macro causes a a function to be run on a test and has no effect on non-functions
68
64
LL | impl Foo for i32 {}
69
65
| ------------------- expected a non-associated function, found an implementation
70
66
|
71
- = note: the `#[test]` macro causes a a function to be run on a test and has no effect on non-functions
72
67
help: replace with conditional compilation to make the item only exist when tests are being run
73
68
|
74
69
LL | #[cfg(test)]
@@ -78,11 +73,10 @@ error: the `#[test]` attribute may only be used on a non-associated function
78
73
--> $DIR/test-on-not-fn.rs:29:1
79
74
|
80
75
LL | #[test]
81
- | ^^^^^^^
76
+ | ^^^^^^^ the `#[test]` macro causes a a function to be run on a test and has no effect on non-functions
82
77
LL | const FOO: i32 = -1_i32;
83
78
| ------------------------ expected a non-associated function, found a constant item
84
79
|
85
- = note: the `#[test]` macro causes a a function to be run on a test and has no effect on non-functions
86
80
help: replace with conditional compilation to make the item only exist when tests are being run
87
81
|
88
82
LL | #[cfg(test)]
@@ -92,11 +86,10 @@ error: the `#[test]` attribute may only be used on a non-associated function
92
86
--> $DIR/test-on-not-fn.rs:32:1
93
87
|
94
88
LL | #[test]
95
- | ^^^^^^^
89
+ | ^^^^^^^ the `#[test]` macro causes a a function to be run on a test and has no effect on non-functions
96
90
LL | static BAR: u64 = 10_000_u64;
97
91
| ----------------------------- expected a non-associated function, found a static item
98
92
|
99
- = note: the `#[test]` macro causes a a function to be run on a test and has no effect on non-functions
100
93
help: replace with conditional compilation to make the item only exist when tests are being run
101
94
|
102
95
LL | #[cfg(test)]
@@ -106,13 +99,12 @@ error: the `#[test]` attribute may only be used on a non-associated function
106
99
--> $DIR/test-on-not-fn.rs:35:1
107
100
|
108
101
LL | #[test]
109
- | ^^^^^^^
102
+ | ^^^^^^^ the `#[test]` macro causes a a function to be run on a test and has no effect on non-functions
110
103
LL | / enum MyUnit {
111
104
LL | | Unit,
112
105
LL | | }
113
106
| |_- expected a non-associated function, found an enum
114
107
|
115
- = note: the `#[test]` macro causes a a function to be run on a test and has no effect on non-functions
116
108
help: replace with conditional compilation to make the item only exist when tests are being run
117
109
|
118
110
LL | #[cfg(test)]
@@ -122,11 +114,10 @@ error: the `#[test]` attribute may only be used on a non-associated function
122
114
--> $DIR/test-on-not-fn.rs:40:1
123
115
|
124
116
LL | #[test]
125
- | ^^^^^^^
117
+ | ^^^^^^^ the `#[test]` macro causes a a function to be run on a test and has no effect on non-functions
126
118
LL | struct NewI32(i32);
127
119
| ------------------- expected a non-associated function, found a struct
128
120
|
129
- = note: the `#[test]` macro causes a a function to be run on a test and has no effect on non-functions
130
121
help: replace with conditional compilation to make the item only exist when tests are being run
131
122
|
132
123
LL | #[cfg(test)]
@@ -136,14 +127,13 @@ error: the `#[test]` attribute may only be used on a non-associated function
136
127
--> $DIR/test-on-not-fn.rs:43:1
137
128
|
138
129
LL | #[test]
139
- | ^^^^^^^
130
+ | ^^^^^^^ the `#[test]` macro causes a a function to be run on a test and has no effect on non-functions
140
131
LL | / union Spooky {
141
132
LL | | x: i32,
142
133
LL | | y: u32,
143
134
LL | | }
144
135
| |_- expected a non-associated function, found a union
145
136
|
146
- = note: the `#[test]` macro causes a a function to be run on a test and has no effect on non-functions
147
137
help: replace with conditional compilation to make the item only exist when tests are being run
148
138
|
149
139
LL | #[cfg(test)]
@@ -153,33 +143,31 @@ error: the `#[test]` attribute may only be used on a non-associated function
153
143
--> $DIR/test-on-not-fn.rs:50:1
154
144
|
155
145
LL | #[test]
156
- | ^^^^^^^
146
+ | ^^^^^^^ the `#[test]` macro causes a a function to be run on a test and has no effect on non-functions
157
147
LL | #[derive(Copy, Clone, Debug)]
158
148
LL | / struct MoreAttrs {
159
149
LL | | a: i32,
160
150
LL | | b: u64,
161
151
LL | | }
162
152
| |_- expected a non-associated function, found a struct
163
153
|
164
- = note: the `#[test]` macro causes a a function to be run on a test and has no effect on non-functions
165
154
help: replace with conditional compilation to make the item only exist when tests are being run
166
155
|
167
156
LL | #[cfg(test)]
168
157
| ~~~~~~~~~~~~
169
158
170
- error : the `#[test]` attribute may only be used on a non-associated function
159
+ warning : the `#[test]` attribute may only be used on a non-associated function
171
160
--> $DIR/test-on-not-fn.rs:61:1
172
161
|
173
162
LL | #[test]
174
- | ^^^^^^^
163
+ | ^^^^^^^ the `#[test]` macro causes a a function to be run on a test and has no effect on non-functions
175
164
LL | foo!();
176
165
| ------- expected a non-associated function, found an item macro invocation
177
166
|
178
- = note: the `#[test]` macro causes a a function to be run on a test and has no effect on non-functions
179
167
help: replace with conditional compilation to make the item only exist when tests are being run
180
168
|
181
169
LL | #[cfg(test)]
182
170
| ~~~~~~~~~~~~
183
171
184
- error: aborting due to 12 previous errors
172
+ error: aborting due to 11 previous errors; 1 warning emitted
185
173
0 commit comments