summaryrefslogtreecommitdiffstats
path: root/tests/rustdoc/deref-to-primitive.rs
blob: 527de780d48923c5d2b3ba501ed5e2f8b4b20397 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#![crate_name = "foo"]

// @has 'foo/struct.Foo.html'
// @has - '//*[@id="deref-methods-i32"]' 'Methods from Deref<Target = i32>'
// @has - '//*[@id="deref-methods-i32-1"]//*[@id="associatedconstant.BITS"]/h4' \
//        'pub const BITS: u32 = 32u32'
pub struct Foo(i32);

impl std::ops::Deref for Foo {
    type Target = i32;

    fn deref(&self) -> &Self::Target {
        &self.0
    }
}