diff options
| author | Aaron Hill <aa1ronham@gmail.com> | 2017-04-09 12:00:34 -0400 |
|---|---|---|
| committer | Aaron Hill <aa1ronham@gmail.com> | 2017-04-09 12:12:05 -0400 |
| commit | 63a291febac3ba2cb48787fed24388c2817ef4a2 (patch) | |
| tree | b363bb6ae1dd08b28f2d687932825a42651c225a /src/test/rustdoc | |
| parent | 53f4bc311b5ff11a16185dd40dc116cf6b8cc162 (diff) | |
| download | rust-63a291febac3ba2cb48787fed24388c2817ef4a2.tar.gz rust-63a291febac3ba2cb48787fed24388c2817ef4a2.zip | |
Fix rustdoc infinitely recursing when an external crate reexports itself
Previously, rustdoc's LibEmbargoVisitor unconditionally visited the child modules of an external crate. If a module re-exported its parent via 'pub use super::*', rustdoc would re-walk the parent, leading to infinite recursion. This commit makes LibEmbargoVisitor store already visited modules in an FxHashSet, ensuring that each module is only walked once. Fixes #40936
Diffstat (limited to 'src/test/rustdoc')
| -rw-r--r-- | src/test/rustdoc/auxiliary/issue-40936.rs | 15 | ||||
| -rw-r--r-- | src/test/rustdoc/issue-40936.rs | 16 |
2 files changed, 31 insertions, 0 deletions
diff --git a/src/test/rustdoc/auxiliary/issue-40936.rs b/src/test/rustdoc/auxiliary/issue-40936.rs new file mode 100644 index 00000000000..54cc18cca23 --- /dev/null +++ b/src/test/rustdoc/auxiliary/issue-40936.rs @@ -0,0 +1,15 @@ +// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or +// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license +// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +pub mod outermod { + pub mod innermod { + pub use super::*; + } +} diff --git a/src/test/rustdoc/issue-40936.rs b/src/test/rustdoc/issue-40936.rs new file mode 100644 index 00000000000..3e02eec1b9c --- /dev/null +++ b/src/test/rustdoc/issue-40936.rs @@ -0,0 +1,16 @@ +// Copyright 2017 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or +// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license +// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// aux-build:issue-40936.rs +// build-aux-docs + +#![crate_name = "foo"] + +extern crate issue_40936; |
