mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-29 20:46:07 +03:00
rustdoc: avoid cleaning modules with duplicate names
This commit is contained in:
@@ -55,9 +55,11 @@ pub(crate) fn clean_doc_module<'tcx>(doc: &DocModule<'tcx>, cx: &mut DocContext<
|
||||
}
|
||||
item
|
||||
}));
|
||||
items.extend(doc.mods.iter().map(|x| {
|
||||
inserted.insert((ItemType::Module, x.name));
|
||||
clean_doc_module(x, cx)
|
||||
items.extend(doc.mods.iter().filter_map(|x| {
|
||||
if !inserted.insert((ItemType::Module, x.name)) {
|
||||
return None;
|
||||
}
|
||||
Some(clean_doc_module(x, cx))
|
||||
}));
|
||||
|
||||
// Split up imports from all other items.
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
#![crate_name = "foo"]
|
||||
|
||||
pub mod sub {
|
||||
pub struct Item;
|
||||
|
||||
pub mod prelude {
|
||||
pub use super::Item;
|
||||
}
|
||||
}
|
||||
|
||||
// @count foo/index.html '//a[@class="mod"][@title="foo::prelude mod"]' 1
|
||||
pub mod prelude {}
|
||||
|
||||
#[doc(inline)]
|
||||
pub use sub::*;
|
||||
Reference in New Issue
Block a user