about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorManish Goregaokar <manishsmail@gmail.com>2016-04-26 01:44:51 +0530
committerManish Goregaokar <manishsmail@gmail.com>2016-04-26 01:44:51 +0530
commit5fba2bfa0adcf9ab63d30b344216e1f4c66b9f43 (patch)
tree4bdcd048a310f2f1858b0a903d00535631258cf8 /src/test
parent1bc30a5621c0bee47bf91dc06bc194f5797ac3bf (diff)
parent6603c95414bd3adb10e6b3ba548f69952df8f290 (diff)
downloadrust-5fba2bfa0adcf9ab63d30b344216e1f4c66b9f43.tar.gz
rust-5fba2bfa0adcf9ab63d30b344216e1f4c66b9f43.zip
Rollup merge of #33133 - mitaa:rdoc-smth-smth-impl, r=alexcrichton
rustdoc: inline all the impls

This used to be done to avoid inlining impls referencing private items, but is now unnecessary since we actually check that impls do not reference non-doc-reachable items.

fixes #32881
fixes #33025
fixes #33113

r? @alexcrichton
Diffstat (limited to 'src/test')
-rw-r--r--src/test/auxiliary/issue-33113.rs17
-rw-r--r--src/test/auxiliary/rustdoc-hidden.rs14
-rw-r--r--src/test/auxiliary/rustdoc-trait-object-impl.rs24
-rw-r--r--src/test/rustdoc/inline_cross/inline_hidden.rs22
-rw-r--r--src/test/rustdoc/inline_cross/issue-32881.rs22
-rw-r--r--src/test/rustdoc/inline_cross/issue-33113.rs20
6 files changed, 119 insertions, 0 deletions
diff --git a/src/test/auxiliary/issue-33113.rs b/src/test/auxiliary/issue-33113.rs
new file mode 100644
index 00000000000..c476dda2690
--- /dev/null
+++ b/src/test/auxiliary/issue-33113.rs
@@ -0,0 +1,17 @@
+// 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.
+
+#![crate_name="bar"]
+
+pub trait Bar {}
+pub struct Foo;
+
+impl<'a> Bar for &'a char {}
+impl Bar for Foo {}
diff --git a/src/test/auxiliary/rustdoc-hidden.rs b/src/test/auxiliary/rustdoc-hidden.rs
new file mode 100644
index 00000000000..aae3eb84fb5
--- /dev/null
+++ b/src/test/auxiliary/rustdoc-hidden.rs
@@ -0,0 +1,14 @@
+// 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.
+
+#[doc(hidden)]
+pub struct Foo;
+
+pub struct Bar;
diff --git a/src/test/auxiliary/rustdoc-trait-object-impl.rs b/src/test/auxiliary/rustdoc-trait-object-impl.rs
new file mode 100644
index 00000000000..317262f4175
--- /dev/null
+++ b/src/test/auxiliary/rustdoc-trait-object-impl.rs
@@ -0,0 +1,24 @@
+// 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.
+
+use std::fmt;
+
+pub trait Bar {}
+
+impl<'a> Bar + 'a {
+    pub fn bar(&self) -> usize { 42 }
+}
+
+impl<'a> fmt::Debug for Bar + 'a {
+    fn fmt(&self, _: &mut fmt::Formatter) -> fmt::Result {
+        Ok(())
+    }
+}
+
diff --git a/src/test/rustdoc/inline_cross/inline_hidden.rs b/src/test/rustdoc/inline_cross/inline_hidden.rs
new file mode 100644
index 00000000000..c59b5afd1c4
--- /dev/null
+++ b/src/test/rustdoc/inline_cross/inline_hidden.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:rustdoc-hidden.rs
+// build-aux-docs
+// ignore-cross-compile
+
+extern crate rustdoc_hidden;
+
+#[doc(no_inline)]
+pub use rustdoc_hidden::Foo;
+
+// @has inline_hidden/fn.foo.html
+// @!has - '//a/@title' 'Foo'
+pub fn foo(_: Foo) {}
diff --git a/src/test/rustdoc/inline_cross/issue-32881.rs b/src/test/rustdoc/inline_cross/issue-32881.rs
new file mode 100644
index 00000000000..948061bdcbe
--- /dev/null
+++ b/src/test/rustdoc/inline_cross/issue-32881.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:rustdoc-trait-object-impl.rs
+// build-aux-docs
+// ignore-cross-compile
+
+extern crate rustdoc_trait_object_impl;
+
+// @has issue_32881/trait.Bar.html
+// @has - '//code' "impl<'a> Bar"
+// @has - '//code' "impl<'a> Debug for Bar"
+
+pub use rustdoc_trait_object_impl::Bar;
+
diff --git a/src/test/rustdoc/inline_cross/issue-33113.rs b/src/test/rustdoc/inline_cross/issue-33113.rs
new file mode 100644
index 00000000000..9ae8fefe730
--- /dev/null
+++ b/src/test/rustdoc/inline_cross/issue-33113.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-33113.rs
+// build-aux-docs
+// ignore-cross-compile
+
+extern crate bar;
+
+// @has issue_33113/trait.Bar.html
+// @has - '//code' "for &'a char"
+// @has - '//code' "for Foo"
+pub use bar::Bar;