@@ -2,11 +2,10 @@ error: the `#[test]` attribute may only be used on a non-associated function
22 --> $DIR/test-on-not-fn.rs:3:1
33 |
44LL | #[test]
5- | ^^^^^^^
5+ | ^^^^^^^ the `#[test]` macro causes a a function to be run on a test and has no effect on non-functions
66LL | mod test {}
77 | ----------- expected a non-associated function, found a module
88 |
9- = note: the `#[test]` macro causes a a function to be run on a test and has no effect on non-functions
109help: replace with conditional compilation to make the item only exist when tests are being run
1110 |
1211LL | #[cfg(test)]
@@ -16,7 +15,7 @@ error: the `#[test]` attribute may only be used on a non-associated function
1615 --> $DIR/test-on-not-fn.rs:6:1
1716 |
1817LL | #[test]
19- | ^^^^^^^
18+ | ^^^^^^^ the `#[test]` macro causes a a function to be run on a test and has no effect on non-functions
2019LL | / mod loooooooooooooong_teeeeeeeeeest {
2120LL | | /*
2221LL | | this is a comment
@@ -26,7 +25,6 @@ LL | | */
2625LL | | }
2726 | |_- expected a non-associated function, found a module
2827 |
29- = note: the `#[test]` macro causes a a function to be run on a test and has no effect on non-functions
3028help: replace with conditional compilation to make the item only exist when tests are being run
3129 |
3230LL | #[cfg(test)]
@@ -36,11 +34,10 @@ error: the `#[test]` attribute may only be used on a non-associated function
3634 --> $DIR/test-on-not-fn.rs:20:1
3735 |
3836LL | #[test]
39- | ^^^^^^^
37+ | ^^^^^^^ the `#[test]` macro causes a a function to be run on a test and has no effect on non-functions
4038LL | extern "C" {}
4139 | ------------- expected a non-associated function, found an extern block
4240 |
43- = note: the `#[test]` macro causes a a function to be run on a test and has no effect on non-functions
4441help: replace with conditional compilation to make the item only exist when tests are being run
4542 |
4643LL | #[cfg(test)]
@@ -50,11 +47,10 @@ error: the `#[test]` attribute may only be used on a non-associated function
5047 --> $DIR/test-on-not-fn.rs:23:1
5148 |
5249LL | #[test]
53- | ^^^^^^^
50+ | ^^^^^^^ the `#[test]` macro causes a a function to be run on a test and has no effect on non-functions
5451LL | trait Foo {}
5552 | ------------ expected a non-associated function, found a trait
5653 |
57- = note: the `#[test]` macro causes a a function to be run on a test and has no effect on non-functions
5854help: replace with conditional compilation to make the item only exist when tests are being run
5955 |
6056LL | #[cfg(test)]
@@ -64,11 +60,10 @@ error: the `#[test]` attribute may only be used on a non-associated function
6460 --> $DIR/test-on-not-fn.rs:26:1
6561 |
6662LL | #[test]
67- | ^^^^^^^
63+ | ^^^^^^^ the `#[test]` macro causes a a function to be run on a test and has no effect on non-functions
6864LL | impl Foo for i32 {}
6965 | ------------------- expected a non-associated function, found an implementation
7066 |
71- = note: the `#[test]` macro causes a a function to be run on a test and has no effect on non-functions
7267help: replace with conditional compilation to make the item only exist when tests are being run
7368 |
7469LL | #[cfg(test)]
@@ -78,11 +73,10 @@ error: the `#[test]` attribute may only be used on a non-associated function
7873 --> $DIR/test-on-not-fn.rs:29:1
7974 |
8075LL | #[test]
81- | ^^^^^^^
76+ | ^^^^^^^ the `#[test]` macro causes a a function to be run on a test and has no effect on non-functions
8277LL | const FOO: i32 = -1_i32;
8378 | ------------------------ expected a non-associated function, found a constant item
8479 |
85- = note: the `#[test]` macro causes a a function to be run on a test and has no effect on non-functions
8680help: replace with conditional compilation to make the item only exist when tests are being run
8781 |
8882LL | #[cfg(test)]
@@ -92,11 +86,10 @@ error: the `#[test]` attribute may only be used on a non-associated function
9286 --> $DIR/test-on-not-fn.rs:32:1
9387 |
9488LL | #[test]
95- | ^^^^^^^
89+ | ^^^^^^^ the `#[test]` macro causes a a function to be run on a test and has no effect on non-functions
9690LL | static BAR: u64 = 10_000_u64;
9791 | ----------------------------- expected a non-associated function, found a static item
9892 |
99- = note: the `#[test]` macro causes a a function to be run on a test and has no effect on non-functions
10093help: replace with conditional compilation to make the item only exist when tests are being run
10194 |
10295LL | #[cfg(test)]
@@ -106,13 +99,12 @@ error: the `#[test]` attribute may only be used on a non-associated function
10699 --> $DIR/test-on-not-fn.rs:35:1
107100 |
108101LL | #[test]
109- | ^^^^^^^
102+ | ^^^^^^^ the `#[test]` macro causes a a function to be run on a test and has no effect on non-functions
110103LL | / enum MyUnit {
111104LL | | Unit,
112105LL | | }
113106 | |_- expected a non-associated function, found an enum
114107 |
115- = note: the `#[test]` macro causes a a function to be run on a test and has no effect on non-functions
116108help: replace with conditional compilation to make the item only exist when tests are being run
117109 |
118110LL | #[cfg(test)]
@@ -122,11 +114,10 @@ error: the `#[test]` attribute may only be used on a non-associated function
122114 --> $DIR/test-on-not-fn.rs:40:1
123115 |
124116LL | #[test]
125- | ^^^^^^^
117+ | ^^^^^^^ the `#[test]` macro causes a a function to be run on a test and has no effect on non-functions
126118LL | struct NewI32(i32);
127119 | ------------------- expected a non-associated function, found a struct
128120 |
129- = note: the `#[test]` macro causes a a function to be run on a test and has no effect on non-functions
130121help: replace with conditional compilation to make the item only exist when tests are being run
131122 |
132123LL | #[cfg(test)]
@@ -136,14 +127,13 @@ error: the `#[test]` attribute may only be used on a non-associated function
136127 --> $DIR/test-on-not-fn.rs:43:1
137128 |
138129LL | #[test]
139- | ^^^^^^^
130+ | ^^^^^^^ the `#[test]` macro causes a a function to be run on a test and has no effect on non-functions
140131LL | / union Spooky {
141132LL | | x: i32,
142133LL | | y: u32,
143134LL | | }
144135 | |_- expected a non-associated function, found a union
145136 |
146- = note: the `#[test]` macro causes a a function to be run on a test and has no effect on non-functions
147137help: replace with conditional compilation to make the item only exist when tests are being run
148138 |
149139LL | #[cfg(test)]
@@ -153,33 +143,31 @@ error: the `#[test]` attribute may only be used on a non-associated function
153143 --> $DIR/test-on-not-fn.rs:50:1
154144 |
155145LL | #[test]
156- | ^^^^^^^
146+ | ^^^^^^^ the `#[test]` macro causes a a function to be run on a test and has no effect on non-functions
157147LL | #[derive(Copy, Clone, Debug)]
158148LL | / struct MoreAttrs {
159149LL | | a: i32,
160150LL | | b: u64,
161151LL | | }
162152 | |_- expected a non-associated function, found a struct
163153 |
164- = note: the `#[test]` macro causes a a function to be run on a test and has no effect on non-functions
165154help: replace with conditional compilation to make the item only exist when tests are being run
166155 |
167156LL | #[cfg(test)]
168157 | ~~~~~~~~~~~~
169158
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
171160 --> $DIR/test-on-not-fn.rs:61:1
172161 |
173162LL | #[test]
174- | ^^^^^^^
163+ | ^^^^^^^ the `#[test]` macro causes a a function to be run on a test and has no effect on non-functions
175164LL | foo!();
176165 | ------- expected a non-associated function, found an item macro invocation
177166 |
178- = note: the `#[test]` macro causes a a function to be run on a test and has no effect on non-functions
179167help: replace with conditional compilation to make the item only exist when tests are being run
180168 |
181169LL | #[cfg(test)]
182170 | ~~~~~~~~~~~~
183171
184- error: aborting due to 12 previous errors
172+ error: aborting due to 11 previous errors; 1 warning emitted
185173
0 commit comments