]>
git.proxmox.com Git - rustc.git/blob - src/test/rustdoc/assoc-types.rs
1 // ignore-tidy-linelength
5 // @has assoc_types/trait.Index.html
6 pub trait Index
<I
: ?Sized
> {
7 // @has - '//*[@id="associatedtype.Output"]//code' 'type Output: ?Sized'
9 // @has - '//*[@id="tymethod.index"]//code' \
10 // "fn index<'a>(&'a self, index: I) -> &'a Self::Output"
11 // @has - '//*[@id="tymethod.index"]//code//a[@href="../assoc_types/trait.Index.html#associatedtype.Output"]' \
13 fn index
<'a
>(&'a
self, index
: I
) -> &'a
Self::Output
;
16 // @has assoc_types/fn.use_output.html
17 // @has - '//*[@class="rust fn"]' '-> &T::Output'
18 // @has - '//*[@class="rust fn"]//a[@href="../assoc_types/trait.Index.html#associatedtype.Output"]' 'Output'
19 pub fn use_output
<T
: Index
<usize>>(obj
: &T
, index
: usize) -> &T
::Output
{
27 // @has assoc_types/fn.use_input.html
28 // @has - '//*[@class="rust fn"]' 'T::Input'
29 // @has - '//*[@class="rust fn"]//a[@href="../assoc_types/trait.Feed.html#associatedtype.Input"]' 'Input'
30 pub fn use_input
<T
: Feed
>(_feed
: &T
, _element
: T
::Input
) { }
32 // @has assoc_types/fn.cmp_input.html
33 // @has - '//*[@class="rust fn"]' 'where T::Input: PartialEq<U::Input>'
34 // @has - '//*[@class="rust fn"]//a[@href="../assoc_types/trait.Feed.html#associatedtype.Input"]' 'Input'
35 pub fn cmp_input
<T
: Feed
, U
: Feed
>(a
: &T
::Input
, b
: &U
::Input
) -> bool
36 where T
::Input
: PartialEq
<U
::Input
>