From 46fdeb24fd16156f73d95272b48604ab967c81db Mon Sep 17 00:00:00 2001 From: Michael Howell Date: Fri, 6 Oct 2023 23:31:16 -0700 Subject: rustdoc: make JS trait impls act more like HTML --- tests/rustdoc-gui/src/test_docs/lib.rs | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'tests/rustdoc-gui/src/test_docs/lib.rs') diff --git a/tests/rustdoc-gui/src/test_docs/lib.rs b/tests/rustdoc-gui/src/test_docs/lib.rs index 5b6d5435b35..138a1b302fd 100644 --- a/tests/rustdoc-gui/src/test_docs/lib.rs +++ b/tests/rustdoc-gui/src/test_docs/lib.rs @@ -167,6 +167,26 @@ impl SomeOtherTypeWithMethodsAndInlining { pub fn some_other_method_directly(&self) {} } +/// Another type alias, this time with methods. +pub struct UnderlyingFooBarBaz; +pub type SomeOtherTypeWithMethodsAndInliningAndTraits = UnderlyingFooBarBaz; + +impl AsRef for UnderlyingFooBarBaz { + fn as_ref(&self) -> &str { + "hello" + } +} + +impl UnderlyingFooBarBaz { + pub fn inherent_fn(&self) {} +} + +impl AsRef for SomeOtherTypeWithMethodsAndInliningAndTraits { + fn as_ref(&self) -> &u8 { + b"hello" + } +} + pub mod huge_amount_of_consts { include!(concat!(env!("OUT_DIR"), "/huge_amount_of_consts.rs")); } -- cgit 1.4.1-3-g733a5