Skip to content

Commit 5358c2f

Browse files
Add tests for impl restriction rendering
1 parent b5acf95 commit 5358c2f

2 files changed

Lines changed: 29 additions & 0 deletions

File tree

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
//@ compile-flags: --document-private-items
2+
#![crate_name = "c"]
3+
#![feature(impl_restriction)]
4+
5+
//@ matches c/trait.Foo.html '//*[@class="stab impl_restriction"]' \
6+
// 'This trait cannot be implemented outside c.$'
7+
//@ has c/trait.Foo.html '//*[@class="stab impl_restriction"]//code' 'c'
8+
pub impl(crate) trait Foo {}
9+
10+
pub mod inner {
11+
//@ matches c/inner/trait.Bar.html '//*[@class="stab impl_restriction"]' \
12+
// 'This trait cannot be implemented outside c::inner.$'
13+
//@ has c/inner/trait.Bar.html '//*[@class="stab impl_restriction"]//code' 'c::inner'
14+
pub impl(self) trait Bar {}
15+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#![crate_name = "c"]
2+
#![feature(impl_restriction)]
3+
4+
//@ matches c/trait.Foo.html '//*[@class="stab impl_restriction"]' \
5+
// 'This trait cannot be implemented outside c.$'
6+
//@ has c/trait.Foo.html '//*[@class="stab impl_restriction"]//code' 'c'
7+
pub impl(crate) trait Foo {}
8+
9+
pub mod inner {
10+
//@ matches c/inner/trait.Bar.html '//*[@class="stab impl_restriction"]' \
11+
// 'This trait cannot be implemented outside c.$'
12+
//@ has c/inner/trait.Bar.html '//*[@class="stab impl_restriction"]//code' 'c'
13+
pub impl(self) trait Bar {}
14+
}

0 commit comments

Comments
 (0)