Skip to content

Commit e3b1be3

Browse files
Remove unneeded ImportItem on glob ones
1 parent 6bea76f commit e3b1be3

File tree

4 files changed

+3
-26
lines changed

4 files changed

+3
-26
lines changed

src/librustdoc/clean/mod.rs

+1-11
Original file line numberDiff line numberDiff line change
@@ -2260,17 +2260,7 @@ impl Clean<Vec<Item>> for doctree::Import<'_> {
22602260
let inner = if self.glob {
22612261
if !denied {
22622262
let mut visited = FxHashSet::default();
2263-
if let Some(mut items) = inline::try_inline_glob(cx, path.res, &mut visited) {
2264-
items.push(Item {
2265-
name: None,
2266-
attrs: self.attrs.clean(cx),
2267-
source: self.span.clean(cx),
2268-
def_id: cx.tcx.hir().local_def_id(self.id).to_def_id(),
2269-
visibility: self.vis.clean(cx),
2270-
stability: None,
2271-
deprecation: None,
2272-
inner: ImportItem(Import::new_glob(resolve_use_source(cx, path), false)),
2273-
});
2263+
if let Some(items) = inline::try_inline_glob(cx, path.res, &mut visited) {
22742264
return items;
22752265
}
22762266
}
-3
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
#![deny(broken_intra_doc_links)]
22

3-
/// [somewhere]
4-
//~^ ERROR unresolved link to `somewhere`
5-
pub use std::str::*;
63
/// [aloha]
74
//~^ ERROR unresolved link to `aloha`
85
pub use std::task::RawWakerVTable;
+2-10
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error: unresolved link to `somewhere`
1+
error: unresolved link to `aloha`
22
--> $DIR/pub-export-lint.rs:3:6
33
|
44
LL | /// [aloha]
@@ -11,13 +11,5 @@ LL | #![deny(broken_intra_doc_links)]
1111
| ^^^^^^^^^^^^^^^^^^^^^^
1212
= help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]`
1313

14-
error: unresolved link to `aloha`
15-
--> $DIR/pub-export-lint.rs:6:6
16-
|
17-
LL | /// [aloha]
18-
| ^^^^^ the module `pub_export_lint` contains no item named `aloha`
19-
|
20-
= help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]`
21-
22-
error: aborting due to 2 previous errors
14+
error: aborting due to previous error
2315

src/test/rustdoc/reexport-check.rs

-2
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,3 @@ pub use std::i32;
77
// @!has 'foo/index.html' '//code' 'pub use self::string::String;'
88
// @has 'foo/index.html' '//tr[@class="module-item"]' 'String'
99
pub use std::string::String;
10-
// @!has 'foo/index.html' '//code' 'pub use self::string::*;'
11-
pub use std::string::*;

0 commit comments

Comments
 (0)