Skip to content

Commit 1af48be

Browse files
Add rustdoc tests for lazy_type_alias
1 parent 60ec840 commit 1af48be

File tree

4 files changed

+49
-0
lines changed

4 files changed

+49
-0
lines changed

tests/rustdoc/alias-reexport.rs

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
// aux-build:alias-reexport.rs
2+
// aux-build:alias-reexport2.rs
3+
4+
#![crate_name = "foo"]
5+
#![feature(lazy_type_alias)]
6+
7+
extern crate alias_reexport2;
8+
9+
// @has 'foo/reexport/fn.foo.html'
10+
// FIXME: should be 'pub fn foo() -> Reexport'
11+
// @has - '//*[@class="rust item-decl"]' 'pub fn foo() -> u8'
12+
// @has 'foo/reexport/fn.foo2.html'
13+
// FIXME: should be 'pub fn foo2() -> Result<Reexport, ()>'
14+
// @has - '//*[@class="rust item-decl"]' 'pub fn foo2() -> Result<u8, ()>'
15+
// @has 'foo/reexport/type.Reexported.html'
16+
// @has - '//*[@class="rust item-decl"]' 'pub type Reexported = u8;'
17+
#[doc(inline)]
18+
pub use alias_reexport2 as reexport;

tests/rustdoc/alias-reexport2.rs

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// gate-test-lazy_type_alias
2+
// aux-build:alias-reexport.rs
3+
4+
#![crate_name = "foo"]
5+
#![feature(lazy_type_alias)]
6+
7+
extern crate alias_reexport;
8+
9+
use alias_reexport::Reexported;
10+
11+
// @has 'foo/fn.foo.html'
12+
// @has - '//*[@class="rust item-decl"]' 'pub fn foo() -> Reexported'
13+
pub fn foo() -> Reexported { 0 }
14+
// @has 'foo/fn.foo2.html'
15+
// @has - '//*[@class="rust item-decl"]' 'pub fn foo2() -> Result<Reexported, ()>'
16+
pub fn foo2() -> Result<Reexported, ()> { Ok(0) }
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#![feature(lazy_type_alias)]
2+
3+
pub type Reexported = u8;
+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#![feature(lazy_type_alias)]
2+
3+
extern crate alias_reexport;
4+
5+
pub use alias_reexport::Reexported;
6+
7+
// @has 'foo/fn.foo.html'
8+
// @has - '//*[@class="docblock item-decl"]' 'pub fn foo() -> Reexported'
9+
pub fn foo() -> Reexported { 0 }
10+
// @has 'foo/fn.foo2.html'
11+
// @has - '//*[@class="docblock item-decl"]' 'pub fn foo2() -> Result<Reexported, ()>'
12+
pub fn foo2() -> Result<Reexported, ()> { Ok(0) }

0 commit comments

Comments
 (0)