]>
git.proxmox.com Git - rustc.git/blob - src/test/rustdoc/normalize-assoc-item.rs
1 // ignore-tidy-linelength
2 // aux-build:normalize-assoc-item.rs
4 // compile-flags:-Znormalize-docs
10 impl Trait
for usize {
14 // @has 'normalize_assoc_item/fn.f.html' '//pre[@class="rust fn"]' 'pub fn f() -> isize'
15 pub fn f() -> <usize as Trait
>::X
{
20 // @has 'normalize_assoc_item/struct.S.html' '//span[@id="structfield.box_me_up"]' 'box_me_up: Box<S, Global>'
21 pub box_me_up
: <S
as Trait
>::X
,
22 // @has 'normalize_assoc_item/struct.S.html' '//span[@id="structfield.generic"]' 'generic: (usize, isize)'
23 pub generic
: <Generic
<usize> as Trait
>::X
,
30 pub struct Generic
<Inner
>(Inner
);
32 impl<Inner
: Trait
> Trait
for Generic
<Inner
> {
33 type X
= (Inner
, Inner
::X
);
36 // These can't be normalized because they depend on a generic parameter.
37 // However the user can choose whether the text should be displayed as `Inner::X` or `<Inner as Trait>::X`.
39 // @has 'normalize_assoc_item/struct.Unknown.html' '//pre[@class="rust struct"]' 'pub struct Unknown<Inner: Trait>(pub <Inner as Trait>::X);'
40 pub struct Unknown
<Inner
: Trait
>(pub <Inner
as Trait
>::X
);
42 // @has 'normalize_assoc_item/struct.Unknown2.html' '//pre[@class="rust struct"]' 'pub struct Unknown2<Inner: Trait>(pub Inner::X);'
43 pub struct Unknown2
<Inner
: Trait
>(pub Inner
::X
);
49 impl<'a
> Lifetimes
<'a
> for usize {
53 // @has 'normalize_assoc_item/fn.g.html' '//pre[@class="rust fn"]' "pub fn g() -> &isize"
54 pub fn g() -> <usize as Lifetimes
<'
static>>::Y
{
58 // @has 'normalize_assoc_item/constant.A.html' '//pre[@class="rust const"]' "pub const A: &isize"
59 pub const A
: <usize as Lifetimes
<'
static>>::Y
= &0;
61 // test cross-crate re-exports
63 // @has 'normalize_assoc_item/fn.foo.html' '//pre[@class="rust fn"]' "pub fn foo() -> i32"
66 // @has 'normalize_assoc_item/fn.h.html' '//pre[@class="rust fn"]' "pub fn h<T>() -> IntoIter<T, Global>"
67 pub fn h
<T
>() -> <Vec
<T
> as IntoIterator
>::IntoIter
{