diff options
Diffstat (limited to 'src/test/ui/generic-associated-types/unsatified-item-lifetime-bound.rs')
-rw-r--r-- | src/test/ui/generic-associated-types/unsatified-item-lifetime-bound.rs | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/test/ui/generic-associated-types/unsatified-item-lifetime-bound.rs b/src/test/ui/generic-associated-types/unsatified-item-lifetime-bound.rs new file mode 100644 index 000000000..8b40dac57 --- /dev/null +++ b/src/test/ui/generic-associated-types/unsatified-item-lifetime-bound.rs @@ -0,0 +1,27 @@ +#![feature(generic_associated_types)] + +pub trait X { + type Y<'a: 'static>; + //~^ WARNING unnecessary lifetime parameter +} + +impl X for () { + type Y<'a> = &'a (); +} + +struct B<'a, T: for<'r> X<Y<'r> = &'r ()>> { + f: <T as X>::Y<'a>, + //~^ ERROR lifetime bound not satisfied +} + +struct C<'a, T: X> { + f: <T as X>::Y<'a>, + //~^ ERROR lifetime bound not satisfied +} + +struct D<'a> { + f: <() as X>::Y<'a>, + //~^ ERROR lifetime bound not satisfied +} + +fn main() {} |