about summary refs log tree commit diff
path: root/tests/ui/associated-types/issue-27901.rs
blob: 3955de2b70536784165b7ff5ced46c101b8dd4a6 (plain)
1
2
3
4
5
6
7
8
9
10
11
//@ run-pass
trait Stream { type Item; }
impl<'a> Stream for &'a str { type Item = u8; }
fn f<'s>(s: &'s str) -> (&'s str, <&'s str as Stream>::Item) {
    (s, 42)
}

fn main() {
    let fx = f as for<'t> fn(&'t str) -> (&'t str, <&'t str as Stream>::Item);
    assert_eq!(fx("hi"), ("hi", 42));
}