]> git.lizzy.rs Git - rust.git/blob - tests/rustdoc/deref-to-primitive.rs
Rollup merge of #106701 - ibraheemdev:sync-sender-spin, r=Amanieu
[rust.git] / tests / rustdoc / deref-to-primitive.rs
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 }