From 631cd5845e8de329d0e227aaa707d7ea228b8f8f Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:20:29 +0200 Subject: Merging upstream version 1.70.0+dfsg1. Signed-off-by: Daniel Baumann --- .../notable-trait/doc-notable_trait-slice.rs | 26 ++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 tests/rustdoc/notable-trait/doc-notable_trait-slice.rs (limited to 'tests/rustdoc/notable-trait/doc-notable_trait-slice.rs') diff --git a/tests/rustdoc/notable-trait/doc-notable_trait-slice.rs b/tests/rustdoc/notable-trait/doc-notable_trait-slice.rs new file mode 100644 index 000000000..ef206710b --- /dev/null +++ b/tests/rustdoc/notable-trait/doc-notable_trait-slice.rs @@ -0,0 +1,26 @@ +#![feature(doc_notable_trait)] + +#[doc(notable_trait)] +pub trait SomeTrait {} + +pub struct SomeStruct; +pub struct OtherStruct; +impl SomeTrait for &[SomeStruct] {} + +// @has doc_notable_trait_slice/fn.bare_fn_matches.html +// @snapshot bare_fn_matches - '//script[@id="notable-traits-data"]' +pub fn bare_fn_matches() -> &'static [SomeStruct] { + &[] +} + +// @has doc_notable_trait_slice/fn.bare_fn_no_matches.html +// @count - '//script[@id="notable-traits-data"]' 0 +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 [] +} -- cgit v1.2.3