diff options
| author | mitaa <mitaa.ceb@gmail.com> | 2016-04-15 16:34:48 +0200 |
|---|---|---|
| committer | mitaa <mitaa.ceb@gmail.com> | 2016-04-18 01:55:54 +0200 |
| commit | cfad7ad947a9b6d6d5117c19618b1d230064dc73 (patch) | |
| tree | c4443a9dd7f481bd8a5a13ab251ec1a32fca95d3 /src/test/rustdoc/inline_cross | |
| parent | ea83349c9f06e13aae4a70e81d5dc470bf051bca (diff) | |
Perform doc-reachability check for inlined impls
This changes the current rule that impls within `doc(hidden)` modules aren't inlined, to only inlining impls where the implemented trait and type are reachable in documentation.
Diffstat (limited to 'src/test/rustdoc/inline_cross')
| -rw-r--r-- | src/test/rustdoc/inline_cross/issue-31948-1.rs | 37 | ||||
| -rw-r--r-- | src/test/rustdoc/inline_cross/issue-31948-2.rs | 31 | ||||
| -rw-r--r-- | src/test/rustdoc/inline_cross/issue-31948.rs | 39 |
3 files changed, 107 insertions, 0 deletions
diff --git a/src/test/rustdoc/inline_cross/issue-31948-1.rs b/src/test/rustdoc/inline_cross/issue-31948-1.rs new file mode 100644 index 00000000000..e953b66fce1 --- /dev/null +++ b/src/test/rustdoc/inline_cross/issue-31948-1.rs @@ -0,0 +1,37 @@ +// 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:rustdoc-nonreachable-impls.rs +// build-aux-docs +// ignore-cross-compile + +extern crate rustdoc_nonreachable_impls; + +// @has issue_31948_1/struct.Wobble.html +// @has - '//*[@class="impl"]//code' 'Bark for' +// @has - '//*[@class="impl"]//code' 'Woof for' +// @!has - '//*[@class="impl"]//code' 'Bar for' +// @!has - '//*[@class="impl"]//code' 'Qux for' +pub use rustdoc_nonreachable_impls::hidden::Wobble; + +// @has issue_31948_1/trait.Bark.html +// FIXME(33025): has - '//code' 'for Foo' +// @has - '//code' 'for Wobble' +// @!has - '//code' 'for Wibble' +pub use rustdoc_nonreachable_impls::Bark; + +// @has issue_31948_1/trait.Woof.html +// FIXME(33025): has - '//code' 'for Foo' +// @has - '//code' 'for Wobble' +// @!has - '//code' 'for Wibble' +pub use rustdoc_nonreachable_impls::Woof; + +// @!has issue_31948_1/trait.Bar.html +// @!has issue_31948_1/trait.Qux.html diff --git a/src/test/rustdoc/inline_cross/issue-31948-2.rs b/src/test/rustdoc/inline_cross/issue-31948-2.rs new file mode 100644 index 00000000000..0423fa1de3b --- /dev/null +++ b/src/test/rustdoc/inline_cross/issue-31948-2.rs @@ -0,0 +1,31 @@ +// 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:rustdoc-nonreachable-impls.rs +// build-aux-docs +// ignore-cross-compile + +extern crate rustdoc_nonreachable_impls; + +// @has issue_31948_2/struct.Wobble.html +// @has - '//*[@class="impl"]//code' 'Qux for' +// @has - '//*[@class="impl"]//code' 'Bark for' +// @has - '//*[@class="impl"]//code' 'Woof for' +// @!has - '//*[@class="impl"]//code' 'Bar for' +pub use rustdoc_nonreachable_impls::hidden::Wobble; + +// @has issue_31948_2/trait.Qux.html +// FIXME(33025): has - '//code' 'for Foo' +// @has - '//code' 'for Wobble' +pub use rustdoc_nonreachable_impls::hidden::Qux; + +// @!has issue_31948_2/trait.Bar.html +// @!has issue_31948_2/trait.Woof.html +// @!has issue_31948_2/trait.Bark.html diff --git a/src/test/rustdoc/inline_cross/issue-31948.rs b/src/test/rustdoc/inline_cross/issue-31948.rs new file mode 100644 index 00000000000..073e8eb50fb --- /dev/null +++ b/src/test/rustdoc/inline_cross/issue-31948.rs @@ -0,0 +1,39 @@ +// 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:rustdoc-nonreachable-impls.rs +// build-aux-docs +// ignore-cross-compile + +extern crate rustdoc_nonreachable_impls; + +// @has issue_31948/struct.Foo.html +// @has - '//*[@class="impl"]//code' 'Bark for' +// @has - '//*[@class="impl"]//code' 'Woof for' +// @!has - '//*[@class="impl"]//code' 'Bar for' +// @!has - '//*[@class="impl"]//code' 'Qux for' +pub use rustdoc_nonreachable_impls::Foo; + +// @has issue_31948/trait.Bark.html +// @has - '//code' 'for Foo' +// @!has - '//code' 'for Wibble' +// @!has - '//code' 'for Wobble' +pub use rustdoc_nonreachable_impls::Bark; + +// @has issue_31948/trait.Woof.html +// @has - '//code' 'for Foo' +// @!has - '//code' 'for Wibble' +// @!has - '//code' 'for Wobble' +pub use rustdoc_nonreachable_impls::Woof; + +// @!has issue_31948/trait.Bar.html +// @!has issue_31948/trait.Qux.html +// @!has issue_31948/struct.Wibble.html +// @!has issue_31948/struct.Wobble.html |
