Skip to content

Commit 1610dc1

Browse files
committed
rustdoc: add regression test for #135092
1 parent 642e49b commit 1610dc1

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
@@ -2772,7 +2772,6 @@ fn clean_maybe_renamed_item<'tcx>(
27722772
import_id: Option<LocalDefId>,
27732773
) -> Vec<Item> {
27742774
use hir::ItemKind;
2775-
27762775
fn get_name(
27772776
cx: &DocContext<'_>,
27782777
item: &hir::Item<'_>,
@@ -2984,6 +2983,7 @@ fn clean_extern_crate<'tcx>(
29842983
&& !cx.is_json_output();
29852984

29862985
let krate_owner_def_id = krate.owner_id.def_id;
2986+
29872987
if please_inline
29882988
&& let Some(items) = inline::try_inline(
29892989
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)