about summary refs log tree commit diff
path: root/src/librustdoc/html
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2020-09-28 00:18:09 +0200
committerGuillaume Gomez <guillaume1.gomez@gmail.com>2020-10-09 20:25:44 +0200
commit31d275e5877d983fecb39bbaad837f6b7cf120d3 (patch)
tree88b79ccd983dcdb7ca4a2a3c555f77af921d2e19 /src/librustdoc/html
parent7c0d576c59e9429157449e617ec5607373afc642 (diff)
downloadrust-31d275e5877d983fecb39bbaad837f6b7cf120d3.tar.gz
rust-31d275e5877d983fecb39bbaad837f6b7cf120d3.zip
Correctly handle "pub use" reexports
Diffstat (limited to 'src/librustdoc/html')
-rw-r--r--src/librustdoc/html/format.rs4
-rw-r--r--src/librustdoc/html/render/mod.rs14
2 files changed, 10 insertions, 8 deletions
diff --git a/src/librustdoc/html/format.rs b/src/librustdoc/html/format.rs
index 2da9c68b196..ece0c247fb5 100644
--- a/src/librustdoc/html/format.rs
+++ b/src/librustdoc/html/format.rs
@@ -1150,14 +1150,14 @@ impl PrintWithSpace for hir::Mutability {
 impl clean::Import {
     crate fn print(&self) -> impl fmt::Display + '_ {
         display_fn(move |f| match *self {
-            clean::Import::Simple(ref name, ref src) => {
+            clean::Import::Simple(ref name, ref src, _) => {
                 if *name == src.path.last_name() {
                     write!(f, "use {};", src.print())
                 } else {
                     write!(f, "use {} as {};", src.print(), *name)
                 }
             }
-            clean::Import::Glob(ref src) => {
+            clean::Import::Glob(ref src, _) => {
                 if src.path.segments.is_empty() {
                     write!(f, "use *;")
                 } else {
diff --git a/src/librustdoc/html/render/mod.rs b/src/librustdoc/html/render/mod.rs
index afd1dc59642..a74e768f980 100644
--- a/src/librustdoc/html/render/mod.rs
+++ b/src/librustdoc/html/render/mod.rs
@@ -2074,12 +2074,14 @@ fn item_module(w: &mut Buffer, cx: &Context, item: &clean::Item, items: &[clean:
             }
 
             clean::ImportItem(ref import) => {
-                write!(
-                    w,
-                    "<tr><td><code>{}{}</code></td></tr>",
-                    myitem.visibility.print_with_space(),
-                    import.print()
-                );
+                if import.should_be_displayed() {
+                    write!(
+                        w,
+                        "<tr><td><code>{}{}</code></td></tr>",
+                        myitem.visibility.print_with_space(),
+                        import.print()
+                    );
+                }
             }
 
             _ => {