diff options
Diffstat (limited to '')
-rw-r--r-- | src/test/ui/issues/issue-27901.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/test/ui/issues/issue-27901.rs b/src/test/ui/issues/issue-27901.rs new file mode 100644 index 000000000..ffd90b689 --- /dev/null +++ b/src/test/ui/issues/issue-27901.rs @@ -0,0 +1,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)); +} |