1 error: the `#[test]` attribute may only be used on a non-associated function
2 --> $DIR/test-on-not-fn.rs:3:1
5 | ^^^^^^^ the `#[test]` macro causes a function to be run on a test and has no effect on non-functions
7 | ----------- expected a non-associated function, found a module
9 help: replace with conditional compilation to make the item only exist when tests are being run
14 error: the `#[test]` attribute may only be used on a non-associated function
15 --> $DIR/test-on-not-fn.rs:6:1
18 | ^^^^^^^ the `#[test]` macro causes a function to be run on a test and has no effect on non-functions
19 LL | / mod loooooooooooooong_teeeeeeeeeest {
21 LL | | this is a comment
22 LL | | this comment goes on for a very long time
26 | |_- expected a non-associated function, found a module
28 help: replace with conditional compilation to make the item only exist when tests are being run
33 error: the `#[test]` attribute may only be used on a non-associated function
34 --> $DIR/test-on-not-fn.rs:20:1
37 | ^^^^^^^ the `#[test]` macro causes a function to be run on a test and has no effect on non-functions
39 | ------------- expected a non-associated function, found an extern block
41 help: replace with conditional compilation to make the item only exist when tests are being run
46 error: the `#[test]` attribute may only be used on a non-associated function
47 --> $DIR/test-on-not-fn.rs:23:1
50 | ^^^^^^^ the `#[test]` macro causes a function to be run on a test and has no effect on non-functions
52 | ------------ expected a non-associated function, found a trait
54 help: replace with conditional compilation to make the item only exist when tests are being run
59 error: the `#[test]` attribute may only be used on a non-associated function
60 --> $DIR/test-on-not-fn.rs:26:1
63 | ^^^^^^^ the `#[test]` macro causes a function to be run on a test and has no effect on non-functions
64 LL | impl Foo for i32 {}
65 | ------------------- expected a non-associated function, found an implementation
67 help: replace with conditional compilation to make the item only exist when tests are being run
72 error: the `#[test]` attribute may only be used on a non-associated function
73 --> $DIR/test-on-not-fn.rs:29:1
76 | ^^^^^^^ the `#[test]` macro causes a function to be run on a test and has no effect on non-functions
77 LL | const FOO: i32 = -1_i32;
78 | ------------------------ expected a non-associated function, found a constant item
80 help: replace with conditional compilation to make the item only exist when tests are being run
85 error: the `#[test]` attribute may only be used on a non-associated function
86 --> $DIR/test-on-not-fn.rs:32:1
89 | ^^^^^^^ the `#[test]` macro causes a function to be run on a test and has no effect on non-functions
90 LL | static BAR: u64 = 10_000_u64;
91 | ----------------------------- expected a non-associated function, found a static item
93 help: replace with conditional compilation to make the item only exist when tests are being run
98 error: the `#[test]` attribute may only be used on a non-associated function
99 --> $DIR/test-on-not-fn.rs:35:1
102 | ^^^^^^^ the `#[test]` macro causes a function to be run on a test and has no effect on non-functions
106 | |_- expected a non-associated function, found an enum
108 help: replace with conditional compilation to make the item only exist when tests are being run
113 error: the `#[test]` attribute may only be used on a non-associated function
114 --> $DIR/test-on-not-fn.rs:40:1
117 | ^^^^^^^ the `#[test]` macro causes a function to be run on a test and has no effect on non-functions
118 LL | struct NewI32(i32);
119 | ------------------- expected a non-associated function, found a struct
121 help: replace with conditional compilation to make the item only exist when tests are being run
126 error: the `#[test]` attribute may only be used on a non-associated function
127 --> $DIR/test-on-not-fn.rs:43:1
130 | ^^^^^^^ the `#[test]` macro causes a function to be run on a test and has no effect on non-functions
131 LL | / union Spooky {
135 | |_- expected a non-associated function, found a union
137 help: replace with conditional compilation to make the item only exist when tests are being run
142 error: the `#[test]` attribute may only be used on a non-associated function
143 --> $DIR/test-on-not-fn.rs:50:1
146 | ^^^^^^^ the `#[test]` macro causes a function to be run on a test and has no effect on non-functions
147 LL | #[derive(Copy, Clone, Debug)]
148 LL | / struct MoreAttrs {
152 | |_- expected a non-associated function, found a struct
154 help: replace with conditional compilation to make the item only exist when tests are being run
159 warning: the `#[test]` attribute may only be used on a non-associated function
160 --> $DIR/test-on-not-fn.rs:61:1
163 | ^^^^^^^ the `#[test]` macro causes a function to be run on a test and has no effect on non-functions
165 | ------- expected a non-associated function, found an item macro invocation
167 help: replace with conditional compilation to make the item only exist when tests are being run
172 error: aborting due to 11 previous errors; 1 warning emitted