Skip to content

Commit f7321be

Browse files
committed
rustdoc: add regression test for issue 135092
1 parent 3b9d04c commit f7321be

File tree

2 files changed

+28
-2
lines changed

2 files changed

+28
-2
lines changed

src/librustdoc/clean/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ pub(crate) fn clean_doc_module<'tcx>(doc: &DocModule<'tcx>, cx: &mut DocContext<
8989
Some(item)
9090
}));
9191

92-
// Split up imports from all other items.
92+
// Split up glob imports from all other items.
9393
//
9494
// This covers the case where somebody does an import which should pull in an item,
9595
// but there's already an item with the same namespace and same name. Rust gives
@@ -2761,7 +2761,6 @@ fn clean_maybe_renamed_item<'tcx>(
27612761
import_id: Option<LocalDefId>,
27622762
) -> Vec<Item> {
27632763
use hir::ItemKind;
2764-
27652764
fn get_name(
27662765
cx: &DocContext<'_>,
27672766
item: &hir::Item<'_>,
@@ -2973,6 +2972,7 @@ fn clean_extern_crate<'tcx>(
29732972
&& !cx.is_json_output();
29742973

29752974
let krate_owner_def_id = krate.owner_id.def_id;
2975+
29762976
if please_inline
29772977
&& let Some(items) = inline::try_inline(
29782978
cx,
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// Test to make sure reexports of extern items are combined
2+
// <https://github.com/rust-lang/rust/issues/135092>
3+
4+
#![crate_name = "foo"]
5+
6+
mod native {
7+
extern "C" {
8+
/// bar.
9+
pub fn bar();
10+
}
11+
12+
/// baz.
13+
pub fn baz() {}
14+
}
15+
16+
//@ has 'foo/fn.bar.html'
17+
//@ has - '//div[@class="docblock"]' 'bar.'
18+
//@ has - '//div[@class="docblock"]' 'foo'
19+
/// foo
20+
pub use native::bar;
21+
22+
//@ has 'foo/fn.baz.html'
23+
//@ has - '//div[@class="docblock"]' 'baz.'
24+
//@ has - '//div[@class="docblock"]' 'foo'
25+
/// foo
26+
pub use native::baz;

0 commit comments

Comments
 (0)