diff options
Diffstat (limited to 'tests/ui/fn/implied-bounds-unnorm-associated-type-2.rs')
-rw-r--r-- | tests/ui/fn/implied-bounds-unnorm-associated-type-2.rs | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/ui/fn/implied-bounds-unnorm-associated-type-2.rs b/tests/ui/fn/implied-bounds-unnorm-associated-type-2.rs new file mode 100644 index 000000000..5d9245556 --- /dev/null +++ b/tests/ui/fn/implied-bounds-unnorm-associated-type-2.rs @@ -0,0 +1,23 @@ +// check-fail + +trait Trait { + type Type; +} + +impl<T> Trait for T { + type Type = (); +} + +fn f<'a, 'b>(_: <&'a &'b () as Trait>::Type) +where + 'a: 'a, + 'b: 'b, +{ +} + +fn g<'a, 'b>() { + f::<'a, 'b>(()); + //~^ ERROR lifetime may not live long enough +} + +fn main() {} |