about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorMichael Howell <michael@notriddle.com>2021-12-10 09:55:36 -0700
committerMichael Howell <michael@notriddle.com>2021-12-10 10:22:10 -0700
commit04cdad0fa587dea94bbde60a39dd55967f7ac7f0 (patch)
tree50368dbbc8cef275ca271747ee966922e5199bc0 /src
parent0b42deaccc2cbe17a68067aa5fdb76104369e1fd (diff)
downloadrust-04cdad0fa587dea94bbde60a39dd55967f7ac7f0.tar.gz
rust-04cdad0fa587dea94bbde60a39dd55967f7ac7f0.zip
Add regression test for #78160
Diffstat (limited to 'src')
-rw-r--r--src/test/rustdoc/doc-notable_trait-mut_t_is_not_ref_t.rs21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/test/rustdoc/doc-notable_trait-mut_t_is_not_ref_t.rs b/src/test/rustdoc/doc-notable_trait-mut_t_is_not_ref_t.rs
new file mode 100644
index 00000000000..b359dcea0ff
--- /dev/null
+++ b/src/test/rustdoc/doc-notable_trait-mut_t_is_not_ref_t.rs
@@ -0,0 +1,21 @@
+//! Test case for [#78160].
+//!
+//! A SomeTrait that is implemented for `&mut T` should not be marked as
+//! "notable" for return values that are `&T`.
+//!
+//! [#78160]: https://github.com/rust-lang/rust/issues/78160
+
+#![feature(rustdoc_internals)]
+
+#[doc(primitive = "reference")]
+/// Some useless docs, wouhou!
+///
+/// We need to put this in here, because notable traits
+/// that are implemented on foreign types don't show up.
+mod reference {}
+
+// @has doc_notable_trait_mut_t_is_not_ref_t/fn.fn_no_matches.html
+// @!has - '//code[@class="content"]' "impl<'_, I> Iterator for &'_ mut I"
+pub fn fn_no_matches<'a, T: Iterator + 'a>() -> &'a T {
+    loop {}
+}