Closed
Description
In #79770 I tried to create a new rustdoc-ui
testcase that runs doctests. However having the mod
substring in a doctest comment injected an invalid extern 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 a issue-XXX/mod.rs
file, and having a doctest such as this triggers the this auto-injection, resulting in a failed doctest run:
/// ```
/// // ^ mod.rs line 10
/// assert_eq!(1, 1);
/// ```