fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

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