about summary refs log tree commit diff
path: root/src/test/auxiliary
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2015-04-07 00:16:35 -0700
committerAlex Crichton <alex@alexcrichton.com>2015-04-07 17:54:34 -0700
commit75ef0832ae00477f837a73356ea7f12f64134c7c (patch)
tree589e3b6fb2f10c5d5905650bbd936b8fd249a04f /src/test/auxiliary
parent11f26f999581e639233e64f4f1fbc210a2bb856a (diff)
downloadrust-75ef0832ae00477f837a73356ea7f12f64134c7c.tar.gz
rust-75ef0832ae00477f837a73356ea7f12f64134c7c.zip
rustdoc: Improve handling inlined associated types
* All bounds are now discovered through the trait to be inlined.
* The `?Sized` bound now renders correctly for inlined associated types.
* All `QPath`s (`<A as B>::C`) instances are rendered as `A::C` where `C` is a
  hyperlink to the trait `B`. This should improve at least how the docs look at
  least.
* Supertrait bounds are now separated and display as the source lists them.

Closes #20727
Closes #21145
Diffstat (limited to 'src/test/auxiliary')
-rw-r--r--src/test/auxiliary/issue-20727.rs38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/test/auxiliary/issue-20727.rs b/src/test/auxiliary/issue-20727.rs
new file mode 100644
index 00000000000..aea8b429d9f
--- /dev/null
+++ b/src/test/auxiliary/issue-20727.rs
@@ -0,0 +1,38 @@
+// Copyright 2015 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 trait Deref {
+    type Target: ?Sized;
+
+    fn deref<'a>(&'a self) -> &'a Self::Target;
+}
+
+pub trait Add<RHS = Self> {
+    type Output;
+
+    fn add(self, rhs: RHS) -> Self::Output;
+}
+
+
+pub trait Bar {}
+pub trait Deref2 {
+    type Target: Bar;
+
+    fn deref(&self) -> Self::Target;
+}
+
+pub trait Index<Idx: ?Sized> {
+    type Output: ?Sized;
+    fn index(&self, index: Idx) -> &Self::Output;
+}
+
+pub trait IndexMut<Idx: ?Sized>: Index<Idx> {
+    fn index_mut(&mut self, index: Idx) -> &mut Self::Output;
+}