diff options
Diffstat (limited to 'tests/ui/generic-associated-types/issue-68648-1.rs')
-rw-r--r-- | tests/ui/generic-associated-types/issue-68648-1.rs | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/ui/generic-associated-types/issue-68648-1.rs b/tests/ui/generic-associated-types/issue-68648-1.rs new file mode 100644 index 000000000..0df41bab3 --- /dev/null +++ b/tests/ui/generic-associated-types/issue-68648-1.rs @@ -0,0 +1,22 @@ +// check-pass + +trait Fun { + type F<'a>; + + fn identity<'a>(t: Self::F<'a>) -> Self::F<'a> { t } +} + +impl <T> Fun for T { + type F<'a> = Self; +} + +fn bug<'a, T: for<'b> Fun<F<'b> = T>>(t: T) -> T::F<'a> { + T::identity(t) +} + + +fn main() { + let x = 10; + + bug(x); +} |