"the main function must be defined at the crate level" for doc test regression 1.81->1.82 #131893
Labels
A-doctests
Area: Documentation tests, run by rustdoc
C-bug
Category: This is a bug.
I-prioritize
Issue: Indicates that prioritization has been requested for this issue.
regression-from-stable-to-stable
Performance or correctness regression from one stable version to another.
T-rustdoc
Relevant to the rustdoc team, which will review and decide on the PR/issue.
The tokio.rs website tests all the code blocks in markdown files by building up a rust file with code included as doc comments on generated functions. The code is generally wrapped in a function to avoid any main functions being interpreted as a test main function. In 1.81, this worked fine, but 1.82 sees the internal main function and treats it as one which prevents the default test main being created.
Code
I tried this code:
I expected to see this happen:
cargo test
should succeedInstead, this happened: cargo test failed
Version it worked on
It most recently worked on: 1.81
rustc --version --verbose
:@rustbot modify labels: +regression-from-stable-to-stable -regression-untriaged
The text was updated successfully, but these errors were encountered: