Skip to content

Commit 3307ad7

Browse files
committed
handle public
1 parent c6a3982 commit 3307ad7

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

text/0000-custom-test-frameworks.md

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -141,15 +141,9 @@ fn main() {
141141
}
142142
```
143143

144-
Because this procedural macro is only loaded when it is used as the
145-
test framework, the `#[mytest]` annotation should probably be kept
146-
behind `#[cfg(mytest)]` (which is automatically set when we are currently running
147-
with the `mytest` framework, i.e. `cargo test --framework mytest` is being run)
148-
so that you don't get unknown attribute warnings
149-
whilst loading, and to avoid conflicts with other frameworks
150-
that may use the same attributes. (We could change this by asking
151-
attributes to be registered in Cargo.toml, but we don't find this
152-
necessary)
144+
The compiler will make marked items `pub(crate)` (i.e. by making
145+
all their parent modules public). `#[test]` and `#[bench]` items will only exist
146+
with `--cfg test` (or bench), which is automatically set when running tests.
153147

154148

155149
A crate may only define a single framework.

0 commit comments

Comments
 (0)