Skip to content

Commit da89d10

Browse files
committed
Add test for rustdoc showing underscore as assoc const value
1 parent 044885c commit da89d10

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
pub struct Struct {
2+
_private: (),
3+
}
4+
5+
pub trait Trait {
6+
//@ has assoc_consts_underscore/trait.Trait.html '//pre[@class="rust item-decl"]' \
7+
// 'const REQUIRED: Struct;'
8+
//@ !has - '//*[@id="associatedconstant.REQUIRED"]' 'const REQUIRED: Struct = _'
9+
//@ has - '//*[@id="associatedconstant.REQUIRED"]' 'const REQUIRED: Struct'
10+
const REQUIRED: Struct;
11+
//@ has - '//pre[@class="rust item-decl"]' 'const OPTIONAL: Struct = _;'
12+
//@ has - '//*[@id="associatedconstant.OPTIONAL"]' 'const OPTIONAL: Struct = _'
13+
const OPTIONAL: Struct = Struct { _private: () };
14+
}
15+
16+
impl Trait for Struct {
17+
//@ has assoc_consts_underscore/struct.Struct.html '//*[@id="associatedconstant.REQUIRED"]' \
18+
// 'const REQUIRED: Struct = _'
19+
const REQUIRED: Struct = Struct { _private: () };
20+
//@ has - '//*[@id="associatedconstant.OPTIONAL"]' 'const OPTIONAL: Struct = _'
21+
const OPTIONAL: Struct = Struct { _private: () };
22+
}
23+
24+
impl Struct {
25+
//@ has - '//*[@id="associatedconstant.INHERENT"]' 'const INHERENT: Struct = _'
26+
pub const INHERENT: Struct = Struct { _private: () };
27+
}

0 commit comments

Comments
 (0)