]>
git.proxmox.com Git - rustc.git/blob - tests/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 {
18 impl Trait
for isize {
19 type X
= <() as Trait
>::X
;
22 // @has 'normalize_assoc_item/fn.f.html' '//div[@class="item-decl"]/pre[@class="rust"]' 'pub fn f() -> isize'
23 pub fn f() -> <usize as Trait
>::X
{
27 // @has 'normalize_assoc_item/fn.f2.html' '//div[@class="item-decl"]/pre[@class="rust"]' 'pub fn f2() -> fn() -> i32'
28 pub fn f2() -> <isize as Trait
>::X
{
33 // @has 'normalize_assoc_item/struct.S.html' '//span[@id="structfield.box_me_up"]' 'box_me_up: Box<S, Global>'
34 pub box_me_up
: <S
as Trait
>::X
,
35 // @has 'normalize_assoc_item/struct.S.html' '//span[@id="structfield.generic"]' 'generic: (usize, isize)'
36 pub generic
: <Generic
<usize> as Trait
>::X
,
43 pub struct Generic
<Inner
>(Inner
);
45 impl<Inner
: Trait
> Trait
for Generic
<Inner
> {
46 type X
= (Inner
, Inner
::X
);
49 // These can't be normalized because they depend on a generic parameter.
50 // However the user can choose whether the text should be displayed as `Inner::X` or `<Inner as Trait>::X`.
52 // @has 'normalize_assoc_item/struct.Unknown.html' '//div[@class="item-decl"]/pre[@class="rust"]' 'pub struct Unknown<Inner: Trait>(pub <Inner as Trait>::X);'
53 pub struct Unknown
<Inner
: Trait
>(pub <Inner
as Trait
>::X
);
55 // @has 'normalize_assoc_item/struct.Unknown2.html' '//div[@class="item-decl"]/pre[@class="rust"]' 'pub struct Unknown2<Inner: Trait>(pub Inner::X);'
56 pub struct Unknown2
<Inner
: Trait
>(pub Inner
::X
);
62 impl<'a
> Lifetimes
<'a
> for usize {
66 // @has 'normalize_assoc_item/fn.g.html' '//div[@class="item-decl"]/pre[@class="rust"]' "pub fn g() -> &isize"
67 pub fn g() -> <usize as Lifetimes
<'
static>>::Y
{
71 // @has 'normalize_assoc_item/constant.A.html' '//div[@class="item-decl"]/pre[@class="rust"]' "pub const A: &isize"
72 pub const A
: <usize as Lifetimes
<'
static>>::Y
= &0;
74 // test cross-crate re-exports
76 // @has 'normalize_assoc_item/fn.foo.html' '//div[@class="item-decl"]/pre[@class="rust"]' "pub fn foo() -> i32"
79 // @has 'normalize_assoc_item/fn.h.html' '//div[@class="item-decl"]/pre[@class="rust"]' "pub fn h<T>() -> IntoIter<T, Global>"
80 pub fn h
<T
>() -> <Vec
<T
> as IntoIterator
>::IntoIter
{