|
| 1 | +error: the `#[test]` attribute may only be used on a non-associated function |
| 2 | + --> $DIR/gating-of-test-attrs.rs:5:1 |
| 3 | + | |
| 4 | +LL | #[test] |
| 5 | + | ^^^^^^^ the `#[test]` macro causes a function to be run as a test and has no effect on non-functions |
| 6 | +LL | |
| 7 | +LL | / mod test { |
| 8 | +LL | | mod inner { #![test] } |
| 9 | +... | |
| 10 | +LL | | impl S { } |
| 11 | +LL | | } |
| 12 | + | |_- expected a non-associated function, found a module |
| 13 | + | |
| 14 | +help: replace with conditional compilation to make the item only exist when tests are being run |
| 15 | + | |
| 16 | +LL - #[test] |
| 17 | +LL + #[cfg(test)] |
| 18 | + | |
| 19 | + |
| 20 | +error[E0658]: inner macro attributes are unstable |
| 21 | + --> $DIR/gating-of-test-attrs.rs:8:20 |
| 22 | + | |
| 23 | +LL | mod inner { #![test] } |
| 24 | + | ^^^^ |
| 25 | + | |
| 26 | + = note: see issue #54726 <https://github.com/rust-lang/rust/issues/54726> for more information |
| 27 | + = help: add `#![feature(custom_inner_attributes)]` to the crate attributes to enable |
| 28 | + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date |
| 29 | + |
| 30 | +error: the `#[test]` attribute may only be used on a non-associated function |
| 31 | + --> $DIR/gating-of-test-attrs.rs:8:17 |
| 32 | + | |
| 33 | +LL | mod inner { #![test] } |
| 34 | + | ------------^^^^^^^^-- |
| 35 | + | | | |
| 36 | + | | the `#[test]` macro causes a function to be run as a test and has no effect on non-functions |
| 37 | + | expected a non-associated function, found a module |
| 38 | + | |
| 39 | +help: replace with conditional compilation to make the item only exist when tests are being run |
| 40 | + | |
| 41 | +LL - mod inner { #![test] } |
| 42 | +LL + mod inner { #[cfg(test)] } |
| 43 | + | |
| 44 | + |
| 45 | +error: the `#[test]` attribute may only be used on a non-associated function |
| 46 | + --> $DIR/gating-of-test-attrs.rs:12:5 |
| 47 | + | |
| 48 | +LL | #[test] |
| 49 | + | ^^^^^^^ the `#[test]` macro causes a function to be run as a test and has no effect on non-functions |
| 50 | +LL | |
| 51 | +LL | struct S; |
| 52 | + | --------- expected a non-associated function, found a struct |
| 53 | + | |
| 54 | +help: replace with conditional compilation to make the item only exist when tests are being run |
| 55 | + | |
| 56 | +LL - #[test] |
| 57 | +LL + #[cfg(test)] |
| 58 | + | |
| 59 | + |
| 60 | +error: the `#[test]` attribute may only be used on a non-associated function |
| 61 | + --> $DIR/gating-of-test-attrs.rs:16:5 |
| 62 | + | |
| 63 | +LL | #[test] |
| 64 | + | ^^^^^^^ the `#[test]` macro causes a function to be run as a test and has no effect on non-functions |
| 65 | +LL | |
| 66 | +LL | type T = S; |
| 67 | + | ----------- expected a non-associated function, found a type alias |
| 68 | + | |
| 69 | +help: replace with conditional compilation to make the item only exist when tests are being run |
| 70 | + | |
| 71 | +LL - #[test] |
| 72 | +LL + #[cfg(test)] |
| 73 | + | |
| 74 | + |
| 75 | +error: the `#[test]` attribute may only be used on a non-associated function |
| 76 | + --> $DIR/gating-of-test-attrs.rs:20:5 |
| 77 | + | |
| 78 | +LL | #[test] |
| 79 | + | ^^^^^^^ the `#[test]` macro causes a function to be run as a test and has no effect on non-functions |
| 80 | +LL | |
| 81 | +LL | impl S { } |
| 82 | + | ---------- expected a non-associated function, found an implementation |
| 83 | + | |
| 84 | +help: replace with conditional compilation to make the item only exist when tests are being run |
| 85 | + | |
| 86 | +LL - #[test] |
| 87 | +LL + #[cfg(test)] |
| 88 | + | |
| 89 | + |
| 90 | +error: the `#[bench]` attribute may only be used on a non-associated function |
| 91 | + --> $DIR/gating-of-test-attrs.rs:28:1 |
| 92 | + | |
| 93 | +LL | #[bench] |
| 94 | + | ^^^^^^^^ the `#[bench]` macro causes a function to be run as a test and has no effect on non-functions |
| 95 | +LL | |
| 96 | +LL | / mod bench { |
| 97 | +LL | | mod inner { #![bench] } |
| 98 | +... | |
| 99 | +LL | | impl S { } |
| 100 | +LL | | } |
| 101 | + | |_- expected a non-associated function, found a module |
| 102 | + |
| 103 | +error[E0658]: inner macro attributes are unstable |
| 104 | + --> $DIR/gating-of-test-attrs.rs:31:20 |
| 105 | + | |
| 106 | +LL | mod inner { #![bench] } |
| 107 | + | ^^^^^ |
| 108 | + | |
| 109 | + = note: see issue #54726 <https://github.com/rust-lang/rust/issues/54726> for more information |
| 110 | + = help: add `#![feature(custom_inner_attributes)]` to the crate attributes to enable |
| 111 | + = note: this compiler was built on YYYY-MM-DD; consider upgrading it if it is out of date |
| 112 | + |
| 113 | +error: the `#[bench]` attribute may only be used on a non-associated function |
| 114 | + --> $DIR/gating-of-test-attrs.rs:31:17 |
| 115 | + | |
| 116 | +LL | mod inner { #![bench] } |
| 117 | + | ------------^^^^^^^^^-- |
| 118 | + | | | |
| 119 | + | | the `#[bench]` macro causes a function to be run as a test and has no effect on non-functions |
| 120 | + | expected a non-associated function, found a module |
| 121 | + |
| 122 | +error: the `#[bench]` attribute may only be used on a non-associated function |
| 123 | + --> $DIR/gating-of-test-attrs.rs:35:5 |
| 124 | + | |
| 125 | +LL | #[bench] |
| 126 | + | ^^^^^^^^ the `#[bench]` macro causes a function to be run as a test and has no effect on non-functions |
| 127 | +LL | |
| 128 | +LL | struct S; |
| 129 | + | --------- expected a non-associated function, found a struct |
| 130 | + |
| 131 | +error: the `#[bench]` attribute may only be used on a non-associated function |
| 132 | + --> $DIR/gating-of-test-attrs.rs:39:5 |
| 133 | + | |
| 134 | +LL | #[bench] |
| 135 | + | ^^^^^^^^ the `#[bench]` macro causes a function to be run as a test and has no effect on non-functions |
| 136 | +LL | |
| 137 | +LL | type T = S; |
| 138 | + | ----------- expected a non-associated function, found a type alias |
| 139 | + |
| 140 | +error: the `#[bench]` attribute may only be used on a non-associated function |
| 141 | + --> $DIR/gating-of-test-attrs.rs:43:5 |
| 142 | + | |
| 143 | +LL | #[bench] |
| 144 | + | ^^^^^^^^ the `#[bench]` macro causes a function to be run as a test and has no effect on non-functions |
| 145 | +LL | |
| 146 | +LL | impl S { } |
| 147 | + | ---------- expected a non-associated function, found an implementation |
| 148 | + |
| 149 | +error: aborting due to 12 previous errors |
| 150 | + |
| 151 | +For more information about this error, try `rustc --explain E0658`. |
0 commit comments