1 // ignore-tidy-linelength
2 // aux-build:normalize-assoc-item.rs
13 // @has 'normalize_assoc_item/fn.f.html' '//pre[@class="rust fn"]' 'pub fn f() -> isize'
14 pub fn f() -> <usize as Trait>::X {
19 // @has 'normalize_assoc_item/struct.S.html' '//span[@id="structfield.box_me_up"]' 'box_me_up: Box<S, Global>'
20 pub box_me_up: <S as Trait>::X,
21 // @has 'normalize_assoc_item/struct.S.html' '//span[@id="structfield.generic"]' 'generic: (usize, isize)'
22 pub generic: <Generic<usize> as Trait>::X,
29 pub struct Generic<Inner>(Inner);
31 impl<Inner: Trait> Trait for Generic<Inner> {
32 type X = (Inner, Inner::X);
35 // These can't be normalized because they depend on a generic parameter.
36 // However the user can choose whether the text should be displayed as `Inner::X` or `<Inner as Trait>::X`.
38 // @has 'normalize_assoc_item/struct.Unknown.html' '//pre[@class="rust struct"]' 'pub struct Unknown<Inner: Trait>(pub <Inner as Trait>::X);'
39 pub struct Unknown<Inner: Trait>(pub <Inner as Trait>::X);
41 // @has 'normalize_assoc_item/struct.Unknown2.html' '//pre[@class="rust struct"]' 'pub struct Unknown2<Inner: Trait>(pub Inner::X);'
42 pub struct Unknown2<Inner: Trait>(pub Inner::X);
48 impl<'a> Lifetimes<'a> for usize {
52 // @has 'normalize_assoc_item/fn.g.html' '//pre[@class="rust fn"]' "pub fn g() -> &isize"
53 pub fn g() -> <usize as Lifetimes<'static>>::Y {
57 // @has 'normalize_assoc_item/constant.A.html' '//pre[@class="rust const"]' "pub const A: &isize"
58 pub const A: <usize as Lifetimes<'static>>::Y = &0;
60 // test cross-crate re-exports
62 // @has 'normalize_assoc_item/fn.foo.html' '//pre[@class="rust fn"]' "pub fn foo() -> i32"
65 // @has 'normalize_assoc_item/fn.h.html' '//pre[@class="rust fn"]' "pub fn h<T>() -> IntoIter<T, Global>"
66 pub fn h<T>() -> <Vec<T> as IntoIterator>::IntoIter {