In doc tests, similarly to rustdoc, if the example does not contain fn main, the code block content is wrapped in fn main() { your_code }.
The logic that is used to detect whether the block is flawed though, and may produce false positives.
Continues #2473