diff options
| author | Guillaume Gomez <guillaume.gomez@huawei.com> | 2023-06-19 15:05:46 +0200 |
|---|---|---|
| committer | Guillaume Gomez <guillaume.gomez@huawei.com> | 2023-06-21 13:45:00 +0200 |
| commit | 1af48beed74e9ab652a05c8fe267541ae652eaf6 (patch) | |
| tree | 51b9eb8a6188b50c1ba7d8e407ad17c965abcd00 | |
| parent | 60ec8405eb03bb3da43e11a5415968d8d8852120 (diff) | |
| download | rust-1af48beed74e9ab652a05c8fe267541ae652eaf6.tar.gz rust-1af48beed74e9ab652a05c8fe267541ae652eaf6.zip | |
Add rustdoc tests for `lazy_type_alias`
| -rw-r--r-- | tests/rustdoc/alias-reexport.rs | 18 | ||||
| -rw-r--r-- | tests/rustdoc/alias-reexport2.rs | 16 | ||||
| -rw-r--r-- | tests/rustdoc/auxiliary/alias-reexport.rs | 3 | ||||
| -rw-r--r-- | tests/rustdoc/auxiliary/alias-reexport2.rs | 12 |
4 files changed, 49 insertions, 0 deletions
diff --git a/tests/rustdoc/alias-reexport.rs b/tests/rustdoc/alias-reexport.rs new file mode 100644 index 00000000000..029891197fc --- /dev/null +++ b/tests/rustdoc/alias-reexport.rs @@ -0,0 +1,18 @@ +// aux-build:alias-reexport.rs +// aux-build:alias-reexport2.rs + +#![crate_name = "foo"] +#![feature(lazy_type_alias)] + +extern crate alias_reexport2; + +// @has 'foo/reexport/fn.foo.html' +// FIXME: should be 'pub fn foo() -> Reexport' +// @has - '//*[@class="rust item-decl"]' 'pub fn foo() -> u8' +// @has 'foo/reexport/fn.foo2.html' +// FIXME: should be 'pub fn foo2() -> Result<Reexport, ()>' +// @has - '//*[@class="rust item-decl"]' 'pub fn foo2() -> Result<u8, ()>' +// @has 'foo/reexport/type.Reexported.html' +// @has - '//*[@class="rust item-decl"]' 'pub type Reexported = u8;' +#[doc(inline)] +pub use alias_reexport2 as reexport; diff --git a/tests/rustdoc/alias-reexport2.rs b/tests/rustdoc/alias-reexport2.rs new file mode 100644 index 00000000000..85d3cdad962 --- /dev/null +++ b/tests/rustdoc/alias-reexport2.rs @@ -0,0 +1,16 @@ +// gate-test-lazy_type_alias +// aux-build:alias-reexport.rs + +#![crate_name = "foo"] +#![feature(lazy_type_alias)] + +extern crate alias_reexport; + +use alias_reexport::Reexported; + +// @has 'foo/fn.foo.html' +// @has - '//*[@class="rust item-decl"]' 'pub fn foo() -> Reexported' +pub fn foo() -> Reexported { 0 } +// @has 'foo/fn.foo2.html' +// @has - '//*[@class="rust item-decl"]' 'pub fn foo2() -> Result<Reexported, ()>' +pub fn foo2() -> Result<Reexported, ()> { Ok(0) } diff --git a/tests/rustdoc/auxiliary/alias-reexport.rs b/tests/rustdoc/auxiliary/alias-reexport.rs new file mode 100644 index 00000000000..14fafc02d36 --- /dev/null +++ b/tests/rustdoc/auxiliary/alias-reexport.rs @@ -0,0 +1,3 @@ +#![feature(lazy_type_alias)] + +pub type Reexported = u8; diff --git a/tests/rustdoc/auxiliary/alias-reexport2.rs b/tests/rustdoc/auxiliary/alias-reexport2.rs new file mode 100644 index 00000000000..9f6910572ad --- /dev/null +++ b/tests/rustdoc/auxiliary/alias-reexport2.rs @@ -0,0 +1,12 @@ +#![feature(lazy_type_alias)] + +extern crate alias_reexport; + +pub use alias_reexport::Reexported; + +// @has 'foo/fn.foo.html' +// @has - '//*[@class="docblock item-decl"]' 'pub fn foo() -> Reexported' +pub fn foo() -> Reexported { 0 } +// @has 'foo/fn.foo2.html' +// @has - '//*[@class="docblock item-decl"]' 'pub fn foo2() -> Result<Reexported, ()>' +pub fn foo2() -> Result<Reexported, ()> { Ok(0) } |
