summaryrefslogtreecommitdiffstats
path: root/tests/rustdoc/notable-trait
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--tests/rustdoc/notable-trait/doc-notable_trait-mut_t_is_not_an_iterator.rs (renamed from tests/rustdoc/doc-notable_trait-mut_t_is_not_an_iterator.rs)4
-rw-r--r--tests/rustdoc/notable-trait/doc-notable_trait-mut_t_is_not_ref_t.rs (renamed from tests/rustdoc/doc-notable_trait-mut_t_is_not_ref_t.rs)4
-rw-r--r--tests/rustdoc/notable-trait/doc-notable_trait-slice.bare_fn_matches.html (renamed from tests/rustdoc/doc-notable_trait-slice.bare_fn_matches.html)0
-rw-r--r--tests/rustdoc/notable-trait/doc-notable_trait-slice.rs (renamed from tests/rustdoc/doc-notable_trait-slice.rs)6
-rw-r--r--tests/rustdoc/notable-trait/doc-notable_trait.bare-fn.html (renamed from tests/rustdoc/doc-notable_trait.bare-fn.html)0
-rw-r--r--tests/rustdoc/notable-trait/doc-notable_trait.rs (renamed from tests/rustdoc/doc-notable_trait.rs)0
-rw-r--r--tests/rustdoc/notable-trait/doc-notable_trait.some-struct-new.html (renamed from tests/rustdoc/doc-notable_trait.some-struct-new.html)0
-rw-r--r--tests/rustdoc/notable-trait/doc-notable_trait.wrap-me.html (renamed from tests/rustdoc/doc-notable_trait.wrap-me.html)0
-rw-r--r--tests/rustdoc/notable-trait/doc-notable_trait_box_is_not_an_iterator.rs (renamed from tests/rustdoc/doc-notable_trait_box_is_not_an_iterator.rs)0
-rw-r--r--tests/rustdoc/notable-trait/notable-trait-generics.rs35
-rw-r--r--tests/rustdoc/notable-trait/spotlight-from-dependency.odd.html (renamed from tests/rustdoc/spotlight-from-dependency.odd.html)0
-rw-r--r--tests/rustdoc/notable-trait/spotlight-from-dependency.rs (renamed from tests/rustdoc/spotlight-from-dependency.rs)0
12 files changed, 45 insertions, 4 deletions
diff --git a/tests/rustdoc/doc-notable_trait-mut_t_is_not_an_iterator.rs b/tests/rustdoc/notable-trait/doc-notable_trait-mut_t_is_not_an_iterator.rs
index bfce46cf4..5af5f7616 100644
--- a/tests/rustdoc/doc-notable_trait-mut_t_is_not_an_iterator.rs
+++ b/tests/rustdoc/notable-trait/doc-notable_trait-mut_t_is_not_an_iterator.rs
@@ -6,10 +6,10 @@
//!
//! [#80737]: https://github.com/rust-lang/rust/issues/80737
-#![feature(rustdoc_internals)]
+#![feature(rustc_attrs)]
#![no_std]
-#[doc(primitive = "reference")]
+#[rustc_doc_primitive = "reference"]
/// Some useless docs, wouhou!
///
/// We need to put this in here, because notable traits
diff --git a/tests/rustdoc/doc-notable_trait-mut_t_is_not_ref_t.rs b/tests/rustdoc/notable-trait/doc-notable_trait-mut_t_is_not_ref_t.rs
index b359dcea0..6c980aaa2 100644
--- a/tests/rustdoc/doc-notable_trait-mut_t_is_not_ref_t.rs
+++ b/tests/rustdoc/notable-trait/doc-notable_trait-mut_t_is_not_ref_t.rs
@@ -5,9 +5,9 @@
//!
//! [#78160]: https://github.com/rust-lang/rust/issues/78160
-#![feature(rustdoc_internals)]
+#![feature(rustc_attrs)]
-#[doc(primitive = "reference")]
+#[rustc_doc_primitive = "reference"]
/// Some useless docs, wouhou!
///
/// We need to put this in here, because notable traits
diff --git a/tests/rustdoc/doc-notable_trait-slice.bare_fn_matches.html b/tests/rustdoc/notable-trait/doc-notable_trait-slice.bare_fn_matches.html
index 46be00a08..46be00a08 100644
--- a/tests/rustdoc/doc-notable_trait-slice.bare_fn_matches.html
+++ b/tests/rustdoc/notable-trait/doc-notable_trait-slice.bare_fn_matches.html
diff --git a/tests/rustdoc/doc-notable_trait-slice.rs b/tests/rustdoc/notable-trait/doc-notable_trait-slice.rs
index 2411da8cd..ef206710b 100644
--- a/tests/rustdoc/doc-notable_trait-slice.rs
+++ b/tests/rustdoc/notable-trait/doc-notable_trait-slice.rs
@@ -18,3 +18,9 @@ pub fn bare_fn_matches() -> &'static [SomeStruct] {
pub fn bare_fn_no_matches() -> &'static [OtherStruct] {
&[]
}
+
+// @has doc_notable_trait_slice/fn.bare_fn_mut_no_matches.html
+// @count - '//script[@id="notable-traits-data"]' 0
+pub fn bare_fn_mut_no_matches() -> &'static mut [SomeStruct] {
+ &mut []
+}
diff --git a/tests/rustdoc/doc-notable_trait.bare-fn.html b/tests/rustdoc/notable-trait/doc-notable_trait.bare-fn.html
index f592e3b37..f592e3b37 100644
--- a/tests/rustdoc/doc-notable_trait.bare-fn.html
+++ b/tests/rustdoc/notable-trait/doc-notable_trait.bare-fn.html
diff --git a/tests/rustdoc/doc-notable_trait.rs b/tests/rustdoc/notable-trait/doc-notable_trait.rs
index d8941769f..d8941769f 100644
--- a/tests/rustdoc/doc-notable_trait.rs
+++ b/tests/rustdoc/notable-trait/doc-notable_trait.rs
diff --git a/tests/rustdoc/doc-notable_trait.some-struct-new.html b/tests/rustdoc/notable-trait/doc-notable_trait.some-struct-new.html
index e8f4f6000..e8f4f6000 100644
--- a/tests/rustdoc/doc-notable_trait.some-struct-new.html
+++ b/tests/rustdoc/notable-trait/doc-notable_trait.some-struct-new.html
diff --git a/tests/rustdoc/doc-notable_trait.wrap-me.html b/tests/rustdoc/notable-trait/doc-notable_trait.wrap-me.html
index e7909669b..e7909669b 100644
--- a/tests/rustdoc/doc-notable_trait.wrap-me.html
+++ b/tests/rustdoc/notable-trait/doc-notable_trait.wrap-me.html
diff --git a/tests/rustdoc/doc-notable_trait_box_is_not_an_iterator.rs b/tests/rustdoc/notable-trait/doc-notable_trait_box_is_not_an_iterator.rs
index 3fb00c7db..3fb00c7db 100644
--- a/tests/rustdoc/doc-notable_trait_box_is_not_an_iterator.rs
+++ b/tests/rustdoc/notable-trait/doc-notable_trait_box_is_not_an_iterator.rs
diff --git a/tests/rustdoc/notable-trait/notable-trait-generics.rs b/tests/rustdoc/notable-trait/notable-trait-generics.rs
new file mode 100644
index 000000000..611902aba
--- /dev/null
+++ b/tests/rustdoc/notable-trait/notable-trait-generics.rs
@@ -0,0 +1,35 @@
+#![feature(doc_notable_trait)]
+
+// Notable traits SHOULD NOT be shown when the `impl` has a concrete type and
+// the return type has a generic type.
+pub mod generic_return {
+ pub struct Wrapper<T>(T);
+
+ #[doc(notable_trait)]
+ pub trait NotableTrait {}
+
+ impl NotableTrait for Wrapper<u8> {}
+
+ // @has notable_trait_generics/generic_return/fn.returning.html
+ // @!has - '//a[@class="tooltip"]/@data-notable-ty' 'Wrapper<T>'
+ pub fn returning<T>() -> Wrapper<T> {
+ loop {}
+ }
+}
+
+// Notable traits SHOULD be shown when the `impl` has a generic type and the
+// return type has a concrete type.
+pub mod generic_impl {
+ pub struct Wrapper<T>(T);
+
+ #[doc(notable_trait)]
+ pub trait NotableTrait {}
+
+ impl<T> NotableTrait for Wrapper<T> {}
+
+ // @has notable_trait_generics/generic_impl/fn.returning.html
+ // @has - '//a[@class="tooltip"]/@data-notable-ty' 'Wrapper<u8>'
+ pub fn returning() -> Wrapper<u8> {
+ loop {}
+ }
+}
diff --git a/tests/rustdoc/spotlight-from-dependency.odd.html b/tests/rustdoc/notable-trait/spotlight-from-dependency.odd.html
index 5f54b7522..5f54b7522 100644
--- a/tests/rustdoc/spotlight-from-dependency.odd.html
+++ b/tests/rustdoc/notable-trait/spotlight-from-dependency.odd.html
diff --git a/tests/rustdoc/spotlight-from-dependency.rs b/tests/rustdoc/notable-trait/spotlight-from-dependency.rs
index 426759c7b..426759c7b 100644
--- a/tests/rustdoc/spotlight-from-dependency.rs
+++ b/tests/rustdoc/notable-trait/spotlight-from-dependency.rs