Open
Description
In a crate that has the same name as a top-level module, exporting a name from this module causes rustdoc (and only rustdoc) to error when it is ran.
// Crate name: `this_crate`.
mod this_crate { pub struct Item; }
pub use this_crate::Item;
error[E0659]: `this_crate` is ambiguous
> cargo test --doc Finished test [unoptimized + debuginfo] target(s) in 0.00s Doc-tests this_crate error[E0659]: `this_crate` is ambiguous (name vs any other name during import resolution) --> /tmp/test_dir/no-alloc/src/lib.rs:7:9 | 7 | pub use this_crate::Item; | ^^^^^^^^^^ ambiguous name | = note: `this_crate` could refer to a crate passed with `--extern` = help: use `::this_crate` to refer to this crate unambiguously note: `this_crate` could also refer to the module defined here --> /tmp/test_dir/no-alloc/src/lib.rs:1:1 | 1 | mod this_crate { pub struct Item; } | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = help: use `crate::this_crate` to refer to this module unambiguouslyerror: aborting due to previous error
For more information about this error, try
rustc --explain E0659
.running 0 tests
test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out
> echo $?
0
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
No status