Skip to content

Commit 23c3941

Browse files
Add rustdoc test for Deref to primitive types
1 parent 5856e40 commit 23c3941

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed
+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#![crate_name = "foo"]
2+
3+
// @has 'foo/struct.Foo.html'
4+
// @has - '//*[@id="deref-methods-i32"]' 'Methods from Deref<Target = i32>'
5+
// @has - '//*[@id="deref-methods-i32-1"]//*[@id="associatedconstant.BITS"]/h4' \
6+
// 'pub const BITS: u32 = 32u32'
7+
pub struct Foo(i32);
8+
9+
impl std::ops::Deref for Foo {
10+
type Target = i32;
11+
12+
fn deref(&self) -> &Self::Target {
13+
&self.0
14+
}
15+
}

0 commit comments

Comments
 (0)