Rustdoc creates doctests with extern crate mod;
#79771
Labels
A-doctests
Area: Documentation tests, run by rustdoc
C-bug
Category: This is a bug.
T-rustdoc
Relevant to the rustdoc team, which will review and decide on the PR/issue.
In #79770 I tried to create a new
rustdoc-ui
testcase that runs doctests. However having themod
substring in a doctest comment injected an invalidextern crate mod;
into the code generated for the doctest.Turns out this here is a bit too aggressive:
rust/src/librustdoc/doctest.rs
Lines 533 to 534 in 0f6f2d6
It looks like compiletest actually gave the crate the name
mod
, perhaps because it was defined in aissue-XXX/mod.rs
file, and having a doctest such as this triggers the this auto-injection, resulting in a failed doctest run:The text was updated successfully, but these errors were encountered: