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