Skip to content

Commit f5dc745

Browse files
committed
Add link to implementation description
1 parent 91a2bf7 commit f5dc745

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/rust-2024/rustdoc-doctests.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,15 @@ pub fn subtract(left: u64, right: u64) -> u64 {
3131
}
3232
```
3333

34-
In this example, the two doctests will now be compiled in a single executable. Rustdoc will essentially place each example in a separate function within a single binary. The tests still run in independent processes as they did before, so any global state (like global statics) should still continue to work correctly.
34+
In this example, the two doctests will now be compiled in a single executable. Rustdoc will essentially place each example in a separate function within a single binary. The tests still run in independent processes as they did before, so any global state (like global statics) should still continue to work correctly.[^implementation]
3535

3636
This change is only available in the 2024 Edition to avoid potential incompatibilities with existing doctests which may not work in a combined executable. However, these incompatibilities are expected to be extremely rare.
3737

3838
[doctests]: ../../rustdoc/write-documentation/documentation-tests.html
3939
[libtest harness]: ../../rustc/tests/index.html
4040

41+
[^implementation]: For more information on the details of how this work, see [Doctests - How were they improved?](https://blog.guillaume-gomez.fr/articles/2024-08-17+Doctests+-+How+were+they+improved%3F).
42+
4143
### Standalone tag
4244

4345
In some situations it is not possible for rustdoc to combine examples in a single executable. Rustdoc will attempt to automatically detect if this is not possible, for example:

0 commit comments

Comments
 (0)