]> git.lizzy.rs Git - rust.git/blob - tests/rustdoc/deref-slice-core.rs
Rollup merge of #107580 - lenko-d:default_value_for_a_lifetime_generic_parameter_prod...
[rust.git] / tests / rustdoc / deref-slice-core.rs
1 // https://github.com/rust-lang/rust/issues/95325
2 //
3 // Show methods reachable from Deref of primitive.
4 #![no_std]
5
6 use core::ops::Deref;
7
8 // @has 'deref_slice_core/struct.MyArray.html'
9 // @has '-' '//*[@id="deref-methods-%5BT%5D"]' 'Methods from Deref<Target = [T]>'
10 // @has '-' '//*[@class="impl-items"]//*[@id="method.len"]' 'pub fn len(&self)'
11
12 pub struct MyArray<T> {
13     array: [T; 10],
14 }
15
16 impl<T> Deref for MyArray<T> {
17     type Target = [T];
18
19     fn deref(&self) -> &Self::Target {
20         &self.array
21     }
22 }