diff options
Diffstat (limited to 'src/test/rustdoc-gui/src')
-rw-r--r-- | src/test/rustdoc-gui/src/lib2/lib.rs | 40 | ||||
-rw-r--r-- | src/test/rustdoc-gui/src/staged_api/Cargo.toml | 3 | ||||
-rw-r--r-- | src/test/rustdoc-gui/src/staged_api/lib.rs | 2 | ||||
-rw-r--r-- | src/test/rustdoc-gui/src/test_docs/lib.rs | 32 |
4 files changed, 76 insertions, 1 deletions
diff --git a/src/test/rustdoc-gui/src/lib2/lib.rs b/src/test/rustdoc-gui/src/lib2/lib.rs index 87f91be3a..24aecc70d 100644 --- a/src/test/rustdoc-gui/src/lib2/lib.rs +++ b/src/test/rustdoc-gui/src/lib2/lib.rs @@ -38,11 +38,14 @@ pub trait Trait { #[deprecated = "Whatever [`Foo`](#tadam)"] fn foo() {} + fn fooo(); } impl Trait for Foo { type X = u32; const Y: u32 = 0; + + fn fooo() {} } impl implementors::Whatever for Foo { @@ -143,3 +146,40 @@ pub struct LongItemInfo2; /// Some docs. #[doc(cfg(any(target_os = "android", target_os = "linux", target_os = "emscripten", target_os = "dragonfly", target_os = "freebsd", target_os = "netbsd", target_os = "openbsd")))] impl SimpleTrait for LongItemInfo2 {} + +pub struct WhereWhitespace<T>; + +impl<T> WhereWhitespace<T> { + pub fn new<F>(f: F) -> Self + where + F: FnMut() -> i32, + {} +} + +impl<K, T> Whitespace<&K> for WhereWhitespace<T> +where + K: std::fmt::Debug, +{ + type Output = WhereWhitespace<T>; + fn index(&self, _key: &K) -> &Self::Output { + self + } +} + +pub trait Whitespace<Idx> +where + Idx: ?Sized, +{ + type Output; + fn index(&self, index: Idx) -> &Self::Output; +} + +pub struct ItemInfoAlignmentTest; + +impl ItemInfoAlignmentTest { + /// This method has docs + #[deprecated] + pub fn foo() {} + #[deprecated] + pub fn bar() {} +} diff --git a/src/test/rustdoc-gui/src/staged_api/Cargo.toml b/src/test/rustdoc-gui/src/staged_api/Cargo.toml index 117c4134e..b231be6ee 100644 --- a/src/test/rustdoc-gui/src/staged_api/Cargo.toml +++ b/src/test/rustdoc-gui/src/staged_api/Cargo.toml @@ -7,5 +7,6 @@ edition = "2021" path = "lib.rs" [features] -default = ["some_feature"] +default = ["some_feature", "some_other_feature"] some_feature = [] +some_other_feature = [] diff --git a/src/test/rustdoc-gui/src/staged_api/lib.rs b/src/test/rustdoc-gui/src/staged_api/lib.rs index 0cb460f03..5934593a8 100644 --- a/src/test/rustdoc-gui/src/staged_api/lib.rs +++ b/src/test/rustdoc-gui/src/staged_api/lib.rs @@ -7,4 +7,6 @@ pub struct Foo {} impl Foo { #[stable(feature = "some_feature", since = "1.3.5")] pub fn bar() {} + #[stable(feature = "some_other_feature", since = "1.3.6")] + pub fn yo() {} } diff --git a/src/test/rustdoc-gui/src/test_docs/lib.rs b/src/test/rustdoc-gui/src/test_docs/lib.rs index 1b26aaecb..4eedf7f15 100644 --- a/src/test/rustdoc-gui/src/test_docs/lib.rs +++ b/src/test/rustdoc-gui/src/test_docs/lib.rs @@ -28,6 +28,12 @@ use std::fmt; /// Let's say I'm just some text will ya? /// ``` /// +/// A failing to run one: +/// +/// ```should_panic +/// panic!("tadam"); +/// ``` +/// /// An inlined `code`! pub fn foo() {} @@ -293,3 +299,29 @@ pub mod details { /// </details> pub struct Details; } + +pub mod doc_block_table { + + pub trait DocBlockTableTrait { + fn func(); + } + + /// Struct doc. + /// + /// | header1 | header2 | + /// |--------------------------|--------------------------| + /// | Lorem Ipsum, Lorem Ipsum | Lorem Ipsum, Lorem Ipsum | + pub struct DocBlockTable {} + + impl DocBlockTableTrait for DocBlockTable { + /// Trait impl func doc for struct. + /// + /// | header1 | header2 | + /// |--------------------------|--------------------------| + /// | Lorem Ipsum, Lorem Ipsum | Lorem Ipsum, Lorem Ipsum | + fn func() { + println!(); + } + } + +} |