diff options
Diffstat (limited to 'tests/rustdoc')
| -rw-r--r-- | tests/rustdoc/extern-impl-trait.rs | 2 | ||||
| -rw-r--r-- | tests/rustdoc/impl-everywhere.rs | 2 | ||||
| -rw-r--r-- | tests/rustdoc/inline_cross/auxiliary/impl-sized.rs | 21 | ||||
| -rw-r--r-- | tests/rustdoc/inline_cross/impl-sized.rs | 27 |
4 files changed, 50 insertions, 2 deletions
diff --git a/tests/rustdoc/extern-impl-trait.rs b/tests/rustdoc/extern-impl-trait.rs index 8ab026afd1b..4d8672305a7 100644 --- a/tests/rustdoc/extern-impl-trait.rs +++ b/tests/rustdoc/extern-impl-trait.rs @@ -7,5 +7,5 @@ extern crate extern_impl_trait; // @has 'foo/struct.X.html' '//h4[@class="code-header"]' "impl Foo<Associated = ()> + 'a" pub use extern_impl_trait::X; -// @has 'foo/struct.Y.html' '//h4[@class="code-header"]' "impl ?Sized + Foo<Associated = ()> + 'a" +// @has 'foo/struct.Y.html' '//h4[@class="code-header"]' "impl Foo<Associated = ()> + ?Sized + 'a" pub use extern_impl_trait::Y; diff --git a/tests/rustdoc/impl-everywhere.rs b/tests/rustdoc/impl-everywhere.rs index 44885d4301f..2311c806c18 100644 --- a/tests/rustdoc/impl-everywhere.rs +++ b/tests/rustdoc/impl-everywhere.rs @@ -25,6 +25,6 @@ pub fn foo_foo() -> impl Foo + Foo2 { Bar } -// @has foo/fn.foo_foo_foo.html '//section[@id="main-content"]//pre' "x: &'x impl Foo + Foo2" +// @has foo/fn.foo_foo_foo.html '//section[@id="main-content"]//pre' "x: &'x (impl Foo + Foo2)" pub fn foo_foo_foo<'x>(_x: &'x (impl Foo + Foo2)) { } diff --git a/tests/rustdoc/inline_cross/auxiliary/impl-sized.rs b/tests/rustdoc/inline_cross/auxiliary/impl-sized.rs new file mode 100644 index 00000000000..65f72a3b9ac --- /dev/null +++ b/tests/rustdoc/inline_cross/auxiliary/impl-sized.rs @@ -0,0 +1,21 @@ +use std::fmt::Debug; + +pub fn sized(x: impl Sized) -> impl Sized { + x +} + +pub fn sized_outlives<'a>(x: impl Sized + 'a) -> impl Sized + 'a { + x +} + +pub fn maybe_sized(x: &impl ?Sized) -> &impl ?Sized { + x +} + +pub fn debug_maybe_sized(x: &(impl Debug + ?Sized)) -> &(impl Debug + ?Sized) { + x +} + +pub fn maybe_sized_outlives<'t>(x: &(impl ?Sized + 't)) -> &(impl ?Sized + 't) { + x +} diff --git a/tests/rustdoc/inline_cross/impl-sized.rs b/tests/rustdoc/inline_cross/impl-sized.rs new file mode 100644 index 00000000000..82bdce47478 --- /dev/null +++ b/tests/rustdoc/inline_cross/impl-sized.rs @@ -0,0 +1,27 @@ +#![crate_name = "user"] + +// aux-crate:impl_sized=impl-sized.rs +// edition:2021 + +// @has user/fn.sized.html +// @has - '//pre[@class="rust item-decl"]' "sized(x: impl Sized) -> impl Sized" +pub use impl_sized::sized; + +// @has user/fn.sized_outlives.html +// @has - '//pre[@class="rust item-decl"]' \ +// "sized_outlives<'a>(x: impl Sized + 'a) -> impl Sized + 'a" +pub use impl_sized::sized_outlives; + +// @has user/fn.maybe_sized.html +// @has - '//pre[@class="rust item-decl"]' "maybe_sized(x: &impl ?Sized) -> &impl ?Sized" +pub use impl_sized::maybe_sized; + +// @has user/fn.debug_maybe_sized.html +// @has - '//pre[@class="rust item-decl"]' \ +// "debug_maybe_sized(x: &(impl Debug + ?Sized)) -> &(impl Debug + ?Sized)" +pub use impl_sized::debug_maybe_sized; + +// @has user/fn.maybe_sized_outlives.html +// @has - '//pre[@class="rust item-decl"]' \ +// "maybe_sized_outlives<'t>(x: &(impl ?Sized + 't)) -> &(impl ?Sized + 't)" +pub use impl_sized::maybe_sized_outlives; |
