Skip to content

Commit

Permalink
Remove main function mention.
Browse files Browse the repository at this point in the history
  • Loading branch information
ehuss committed Aug 19, 2024
1 parent 233d37f commit 2dc4b85
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/rust-2024/rustdoc-doctests.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ pub fn subtract(left: u64, right: u64) -> u64 {
}
```

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. Rustdoc also adds a small `main` function which tells it which test to run. The tests still run in independent processes as they did before, so any global state (like global statics) should still continue to work correctly.
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.

This change is only available in the 2024 Edition to avoid potential incompatibilities with existing doctests which may not work in a combined executable.

Expand Down

0 comments on commit 2dc4b85

Please sign in to comment.