Skip to content

Commit 51dd090

Browse files
Add test for empty impl blocks
1 parent 198dea5 commit 51dd090

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

src/test/rustdoc/empty-impl-block.rs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#![crate_name = "foo"]
2+
3+
// @has 'foo/struct.Foo.html'
4+
pub struct Foo;
5+
6+
// @has - '//*[@class="docblock"]' 'Hello empty impl block!'
7+
// @has - '//*[@class="item-info"]' 'This impl block contains no items.'
8+
/// Hello empty impl block!
9+
impl Foo {}
10+
// We ensure that this empty impl block without doc isn't rendered.
11+
// @count - '//*[@class="impl has-srclink"]' 'impl Foo' 1
12+
impl Foo {}
13+
14+
// Just to ensure that empty trait impl blocks are rendered.
15+
pub struct Another;
16+
pub trait Bar {}
17+
18+
// @has 'foo/struct.Another.html'
19+
// @has - '//h3[@class="code-header in-band"]' 'impl Bar for Another'
20+
impl Bar for Another {}

0 commit comments

Comments
 (0)