Add rustdoc tests for lazy_type_alias

This commit is contained in:
Guillaume Gomez 2023-06-19 15:05:46 +02:00
parent 60ec8405eb
commit 1af48beed7
4 changed files with 49 additions and 0 deletions

View file

@ -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;

View file

@ -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) }

View file

@ -0,0 +1,3 @@
#![feature(lazy_type_alias)]
pub type Reexported = u8;

View file

@ -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) }