diff options
| author | Oliver Middleton <olliemail27@gmail.com> | 2016-06-18 18:41:13 +0100 |
|---|---|---|
| committer | Oliver Middleton <olliemail27@gmail.com> | 2016-06-20 22:22:17 +0100 |
| commit | ebfdd110c3ae32e91627f1d75bf089560bf98c9b (patch) | |
| tree | 6d2bb6b79aaf87a44671609c393bef11ac1f7ece /src/test/rustdoc | |
| parent | 3313e50594aeb8e81dbe7bac27addcf41be40f9c (diff) | |
| download | rust-ebfdd110c3ae32e91627f1d75bf089560bf98c9b.tar.gz rust-ebfdd110c3ae32e91627f1d75bf089560bf98c9b.zip | |
rustdoc: Fix a couple of issues with src links to external crates
- src links/redirects to extern fn from another crate had an extra '/'. - src links to `pub use` of a crate module had an extra '/'. - src links to renamed reexports from another crate used the new name for the link but should use the original name.
Diffstat (limited to 'src/test/rustdoc')
| -rw-r--r-- | src/test/rustdoc/auxiliary/issue-34274.rs | 13 | ||||
| -rw-r--r-- | src/test/rustdoc/auxiliary/src-links-external.rs | 11 | ||||
| -rw-r--r-- | src/test/rustdoc/issue-34274.rs | 20 | ||||
| -rw-r--r-- | src/test/rustdoc/src-links-external.rs | 22 |
4 files changed, 66 insertions, 0 deletions
diff --git a/src/test/rustdoc/auxiliary/issue-34274.rs b/src/test/rustdoc/auxiliary/issue-34274.rs new file mode 100644 index 00000000000..72026b60856 --- /dev/null +++ b/src/test/rustdoc/auxiliary/issue-34274.rs @@ -0,0 +1,13 @@ +// Copyright 2016 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. + +extern { + pub fn extern_c_fn(); +} diff --git a/src/test/rustdoc/auxiliary/src-links-external.rs b/src/test/rustdoc/auxiliary/src-links-external.rs new file mode 100644 index 00000000000..94b7278e990 --- /dev/null +++ b/src/test/rustdoc/auxiliary/src-links-external.rs @@ -0,0 +1,11 @@ +// Copyright 2016 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 struct Foo; diff --git a/src/test/rustdoc/issue-34274.rs b/src/test/rustdoc/issue-34274.rs new file mode 100644 index 00000000000..971c89b1619 --- /dev/null +++ b/src/test/rustdoc/issue-34274.rs @@ -0,0 +1,20 @@ +// Copyright 2016 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-34274.rs +// build-aux-docs +// ignore-cross-compile + +#![crate_name = "foo"] + +extern crate issue_34274; + +// @has foo/fn.extern_c_fn.html '//a/@href' '../issue_34274/fn.extern_c_fn.html?gotosrc=' +pub use issue_34274::extern_c_fn; diff --git a/src/test/rustdoc/src-links-external.rs b/src/test/rustdoc/src-links-external.rs new file mode 100644 index 00000000000..e9db4f519ed --- /dev/null +++ b/src/test/rustdoc/src-links-external.rs @@ -0,0 +1,22 @@ +// Copyright 2016 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:src-links-external.rs +// build-aux-docs +// ignore-cross-compile + +#![crate_name = "foo"] + +extern crate src_links_external; + +// @has foo/bar/index.html '//a/@href' '../src_links_external/index.html?gotosrc=' +pub use src_links_external as bar; + +// @has foo/bar/struct.Foo.html '//a/@href' '../src_links_external/struct.Foo.html?gotosrc=' |
