Skip to content

Commit

Permalink
Remove unneeded ImportItem on glob ones
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Oct 9, 2020
1 parent 6bea76f commit e3b1be3
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 26 deletions.
12 changes: 1 addition & 11 deletions src/librustdoc/clean/mod.rs
Expand Up @@ -2260,17 +2260,7 @@ impl Clean<Vec<Item>> for doctree::Import<'_> {
let inner = if self.glob {
if !denied {
let mut visited = FxHashSet::default();
if let Some(mut items) = inline::try_inline_glob(cx, path.res, &mut visited) {
items.push(Item {
name: None,
attrs: self.attrs.clean(cx),
source: self.span.clean(cx),
def_id: cx.tcx.hir().local_def_id(self.id).to_def_id(),
visibility: self.vis.clean(cx),
stability: None,
deprecation: None,
inner: ImportItem(Import::new_glob(resolve_use_source(cx, path), false)),
});
if let Some(items) = inline::try_inline_glob(cx, path.res, &mut visited) {
return items;
}
}
Expand Down
3 changes: 0 additions & 3 deletions src/test/rustdoc-ui/pub-export-lint.rs
@@ -1,8 +1,5 @@
#![deny(broken_intra_doc_links)]

/// [somewhere]
//~^ ERROR unresolved link to `somewhere`
pub use std::str::*;
/// [aloha]
//~^ ERROR unresolved link to `aloha`
pub use std::task::RawWakerVTable;
12 changes: 2 additions & 10 deletions src/test/rustdoc-ui/pub-export-lint.stderr
@@ -1,4 +1,4 @@
error: unresolved link to `somewhere`
error: unresolved link to `aloha`
--> $DIR/pub-export-lint.rs:3:6
|
LL | /// [aloha]
Expand All @@ -11,13 +11,5 @@ LL | #![deny(broken_intra_doc_links)]
| ^^^^^^^^^^^^^^^^^^^^^^
= help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]`

error: unresolved link to `aloha`
--> $DIR/pub-export-lint.rs:6:6
|
LL | /// [aloha]
| ^^^^^ the module `pub_export_lint` contains no item named `aloha`
|
= help: to escape `[` and `]` characters, add '\' before them like `\[` or `\]`

error: aborting due to 2 previous errors
error: aborting due to previous error

2 changes: 0 additions & 2 deletions src/test/rustdoc/reexport-check.rs
Expand Up @@ -7,5 +7,3 @@ pub use std::i32;
// @!has 'foo/index.html' '//code' 'pub use self::string::String;'
// @has 'foo/index.html' '//tr[@class="module-item"]' 'String'
pub use std::string::String;
// @!has 'foo/index.html' '//code' 'pub use self::string::*;'
pub use std::string::*;

0 comments on commit e3b1be3

Please sign in to comment.