185 lines
5.8 KiB
Text
185 lines
5.8 KiB
Text
error: the `#[test]` attribute may only be used on a free function
|
|
--> $DIR/test-on-not-fn.rs:4:1
|
|
|
|
|
LL | #[test]
|
|
| ^^^^^^^ the `#[test]` macro causes a function to be run as a test and has no effect on non-functions
|
|
LL | mod test {}
|
|
| ----------- expected a non-associated function, found a module
|
|
|
|
|
help: replace with conditional compilation to make the item only exist when tests are being run
|
|
|
|
|
LL - #[test]
|
|
LL + #[cfg(test)]
|
|
|
|
|
|
|
error: the `#[test]` attribute may only be used on a free function
|
|
--> $DIR/test-on-not-fn.rs:7:1
|
|
|
|
|
LL | #[test]
|
|
| ^^^^^^^ the `#[test]` macro causes a function to be run as a test and has no effect on non-functions
|
|
LL | / mod loooooooooooooong_teeeeeeeeeest {
|
|
LL | | /*
|
|
LL | | this is a comment
|
|
LL | | this comment goes on for a very long time
|
|
... |
|
|
LL | | */
|
|
LL | | }
|
|
| |_- expected a non-associated function, found a module
|
|
|
|
|
help: replace with conditional compilation to make the item only exist when tests are being run
|
|
|
|
|
LL - #[test]
|
|
LL + #[cfg(test)]
|
|
|
|
|
|
|
error: the `#[test]` attribute may only be used on a free function
|
|
--> $DIR/test-on-not-fn.rs:21:1
|
|
|
|
|
LL | #[test]
|
|
| ^^^^^^^ the `#[test]` macro causes a function to be run as a test and has no effect on non-functions
|
|
LL | extern "C" {}
|
|
| ------------- expected a non-associated function, found an extern block
|
|
|
|
|
help: replace with conditional compilation to make the item only exist when tests are being run
|
|
|
|
|
LL - #[test]
|
|
LL + #[cfg(test)]
|
|
|
|
|
|
|
error: the `#[test]` attribute may only be used on a free function
|
|
--> $DIR/test-on-not-fn.rs:24:1
|
|
|
|
|
LL | #[test]
|
|
| ^^^^^^^ the `#[test]` macro causes a function to be run as a test and has no effect on non-functions
|
|
LL | trait Foo {}
|
|
| ------------ expected a non-associated function, found a trait
|
|
|
|
|
help: replace with conditional compilation to make the item only exist when tests are being run
|
|
|
|
|
LL - #[test]
|
|
LL + #[cfg(test)]
|
|
|
|
|
|
|
error: the `#[test]` attribute may only be used on a free function
|
|
--> $DIR/test-on-not-fn.rs:27:1
|
|
|
|
|
LL | #[test]
|
|
| ^^^^^^^ the `#[test]` macro causes a function to be run as a test and has no effect on non-functions
|
|
LL | impl Foo for i32 {}
|
|
| ------------------- expected a non-associated function, found an implementation
|
|
|
|
|
help: replace with conditional compilation to make the item only exist when tests are being run
|
|
|
|
|
LL - #[test]
|
|
LL + #[cfg(test)]
|
|
|
|
|
|
|
error: the `#[test]` attribute may only be used on a free function
|
|
--> $DIR/test-on-not-fn.rs:30:1
|
|
|
|
|
LL | #[test]
|
|
| ^^^^^^^ the `#[test]` macro causes a function to be run as a test and has no effect on non-functions
|
|
LL | const FOO: i32 = -1_i32;
|
|
| ------------------------ expected a non-associated function, found a constant item
|
|
|
|
|
help: replace with conditional compilation to make the item only exist when tests are being run
|
|
|
|
|
LL - #[test]
|
|
LL + #[cfg(test)]
|
|
|
|
|
|
|
error: the `#[test]` attribute may only be used on a free function
|
|
--> $DIR/test-on-not-fn.rs:33:1
|
|
|
|
|
LL | #[test]
|
|
| ^^^^^^^ the `#[test]` macro causes a function to be run as a test and has no effect on non-functions
|
|
LL | static BAR: u64 = 10_000_u64;
|
|
| ----------------------------- expected a non-associated function, found a static item
|
|
|
|
|
help: replace with conditional compilation to make the item only exist when tests are being run
|
|
|
|
|
LL - #[test]
|
|
LL + #[cfg(test)]
|
|
|
|
|
|
|
error: the `#[test]` attribute may only be used on a free function
|
|
--> $DIR/test-on-not-fn.rs:36:1
|
|
|
|
|
LL | #[test]
|
|
| ^^^^^^^ the `#[test]` macro causes a function to be run as a test and has no effect on non-functions
|
|
LL | / enum MyUnit {
|
|
LL | | Unit,
|
|
LL | | }
|
|
| |_- expected a non-associated function, found an enum
|
|
|
|
|
help: replace with conditional compilation to make the item only exist when tests are being run
|
|
|
|
|
LL - #[test]
|
|
LL + #[cfg(test)]
|
|
|
|
|
|
|
error: the `#[test]` attribute may only be used on a free function
|
|
--> $DIR/test-on-not-fn.rs:41:1
|
|
|
|
|
LL | #[test]
|
|
| ^^^^^^^ the `#[test]` macro causes a function to be run as a test and has no effect on non-functions
|
|
LL | struct NewI32(i32);
|
|
| ------------------- expected a non-associated function, found a struct
|
|
|
|
|
help: replace with conditional compilation to make the item only exist when tests are being run
|
|
|
|
|
LL - #[test]
|
|
LL + #[cfg(test)]
|
|
|
|
|
|
|
error: the `#[test]` attribute may only be used on a free function
|
|
--> $DIR/test-on-not-fn.rs:44:1
|
|
|
|
|
LL | #[test]
|
|
| ^^^^^^^ the `#[test]` macro causes a function to be run as a test and has no effect on non-functions
|
|
LL | / union Spooky {
|
|
LL | | x: i32,
|
|
LL | | y: u32,
|
|
LL | | }
|
|
| |_- expected a non-associated function, found a union
|
|
|
|
|
help: replace with conditional compilation to make the item only exist when tests are being run
|
|
|
|
|
LL - #[test]
|
|
LL + #[cfg(test)]
|
|
|
|
|
|
|
error: the `#[test]` attribute may only be used on a free function
|
|
--> $DIR/test-on-not-fn.rs:51:1
|
|
|
|
|
LL | #[test]
|
|
| ^^^^^^^ the `#[test]` macro causes a function to be run as a test and has no effect on non-functions
|
|
LL | #[derive(Copy, Clone, Debug)]
|
|
LL | / struct MoreAttrs {
|
|
LL | | a: i32,
|
|
LL | | b: u64,
|
|
LL | | }
|
|
| |_- expected a non-associated function, found a struct
|
|
|
|
|
help: replace with conditional compilation to make the item only exist when tests are being run
|
|
|
|
|
LL - #[test]
|
|
LL + #[cfg(test)]
|
|
|
|
|
|
|
warning: the `#[test]` attribute may only be used on a free function
|
|
--> $DIR/test-on-not-fn.rs:62:1
|
|
|
|
|
LL | #[test]
|
|
| ^^^^^^^ the `#[test]` macro causes a function to be run as a test and has no effect on non-functions
|
|
LL | foo!();
|
|
| ------- expected a non-associated function, found an item macro invocation
|
|
|
|
|
help: replace with conditional compilation to make the item only exist when tests are being run
|
|
|
|
|
LL - #[test]
|
|
LL + #[cfg(test)]
|
|
|
|
|
|
|
error: aborting due to 11 previous errors; 1 warning emitted
|
|
|