0
0
mirror of https://github.com/rust-lang/rust.git synced 2024-11-25 12:12:19 +01:00
rust/tests/rustdoc/deref/deref-to-primitive.rs
2024-06-24 11:08:41 +02:00

16 lines
392 B
Rust

#![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
}
}