about summary refs log tree commit diff
path: root/src/test/rustdoc
diff options
context:
space:
mode:
authorkennytm <kennytm@gmail.com>2018-04-04 11:07:22 +0200
committerGitHub <noreply@github.com>2018-04-04 11:07:22 +0200
commit52fd162603f75ae10bafebb9dfdd0acd36f5aab5 (patch)
tree48aa8cacd6625685e154b71eafc3b8377fa16253 /src/test/rustdoc
parente1ebd0a9ee98f3f178b2b58a81479c58f8a07fe6 (diff)
parentf9cc0307fec0c37941186d9588ef437268bd5c92 (diff)
downloadrust-52fd162603f75ae10bafebb9dfdd0acd36f5aab5.tar.gz
rust-52fd162603f75ae10bafebb9dfdd0acd36f5aab5.zip
Rollup merge of #49603 - GuillaumeGomez:fix-intra-link-trait-provided-method, r=QuietMisdreavus
Fix url for intra link provided method

Fixes #49582.

r? @QuietMisdreavus
Diffstat (limited to 'src/test/rustdoc')
-rw-r--r--src/test/rustdoc/default-trait-method-link.rs25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/test/rustdoc/default-trait-method-link.rs b/src/test/rustdoc/default-trait-method-link.rs
new file mode 100644
index 00000000000..9cde446eb94
--- /dev/null
+++ b/src/test/rustdoc/default-trait-method-link.rs
@@ -0,0 +1,25 @@
+// Copyright 2018 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 = "foo"]
+
+// @has foo/trait.Foo.html '//a[@href="../foo/trait.Foo.html#tymethod.req"]' 'req'
+// @has foo/trait.Foo.html '//a[@href="../foo/trait.Foo.html#method.prov"]' 'prov'
+
+/// Always make sure to implement [`req`], but you don't have to implement [`prov`].
+///
+/// [`req`]: Foo::req
+/// [`prov`]: Foo::prov
+pub trait Foo {
+    /// Required
+    fn req();
+    /// Provided
+    fn prov() {}
+}