summary refs log tree commit diff
path: root/src/test/rustdoc
diff options
context:
space:
mode:
authorManish Goregaokar <manishsmail@gmail.com>2020-06-10 00:33:10 -0700
committerManish Goregaokar <manishsmail@gmail.com>2020-06-10 01:04:38 -0700
commit27dcb4aab534741f747354c6a72ff29d0ccce329 (patch)
treef93cfed6336090aa896c70b8f4731896ff7bd6ca /src/test/rustdoc
parente003c3ea059e20a0e04cc953d0d128e0ea69acd8 (diff)
downloadrust-27dcb4aab534741f747354c6a72ff29d0ccce329.tar.gz
rust-27dcb4aab534741f747354c6a72ff29d0ccce329.zip
Avoid collisions between traits and their derive macros
Diffstat (limited to 'src/test/rustdoc')
-rw-r--r--src/test/rustdoc/auxiliary/intra-link-proc-macro-macro.rs5
-rw-r--r--src/test/rustdoc/intra-link-proc-macro.rs6
2 files changed, 10 insertions, 1 deletions
diff --git a/src/test/rustdoc/auxiliary/intra-link-proc-macro-macro.rs b/src/test/rustdoc/auxiliary/intra-link-proc-macro-macro.rs
index fee92ff2e0d..04a431d9902 100644
--- a/src/test/rustdoc/auxiliary/intra-link-proc-macro-macro.rs
+++ b/src/test/rustdoc/auxiliary/intra-link-proc-macro-macro.rs
@@ -19,6 +19,11 @@ pub fn b_derive(input: TokenStream) -> TokenStream {
     input
 }
 
+#[proc_macro_derive(DeriveTrait)]
+pub fn trait_derive(input: TokenStream) -> TokenStream {
+    input
+}
+
 #[proc_macro_attribute]
 pub fn attr_a(input: TokenStream, _args: TokenStream) -> TokenStream {
     input
diff --git a/src/test/rustdoc/intra-link-proc-macro.rs b/src/test/rustdoc/intra-link-proc-macro.rs
index 78ef91ab682..405e08d4c07 100644
--- a/src/test/rustdoc/intra-link-proc-macro.rs
+++ b/src/test/rustdoc/intra-link-proc-macro.rs
@@ -11,7 +11,11 @@ use intra_link_proc_macro_macro::{DeriveB, attr_b};
 
 // @has - '//a/@href' '../intra_link_proc_macro/derive.DeriveA.html'
 // @has - '//a/@href' '../intra_link_proc_macro/attr.attr_a.html'
+// @has - '//a/@href' '../intra_link_proc_macro/trait.DeriveTrait.html'
 // @has - '//a/@href' '../intra_link_proc_macro_macro/derive.DeriveB.html'
 // @has - '//a/@href' '../intra_link_proc_macro_macro/attr.attr_b.html'
-/// Link to [DeriveA], [attr_a], [DeriveB], [attr_b]
+/// Link to [DeriveA], [attr_a], [DeriveB], [attr_b], [DeriveTrait]
 pub struct Foo;
+
+// this should not cause ambiguity errors
+pub trait DeriveTrait {}