diff options
Diffstat (limited to 'src/test/ui/generic-associated-types/unsatisfied-outlives-bound.rs')
-rw-r--r-- | src/test/ui/generic-associated-types/unsatisfied-outlives-bound.rs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/test/ui/generic-associated-types/unsatisfied-outlives-bound.rs b/src/test/ui/generic-associated-types/unsatisfied-outlives-bound.rs new file mode 100644 index 000000000..6466bf98d --- /dev/null +++ b/src/test/ui/generic-associated-types/unsatisfied-outlives-bound.rs @@ -0,0 +1,21 @@ +#![feature(generic_associated_types)] + +trait ATy { + type Item<'a>: 'a; +} + +impl<'b> ATy for &'b () { + type Item<'a> = &'b (); + //~^ ERROR the type `&'b ()` does not fulfill the required lifetime +} + +trait StaticTy { + type Item<'a>: 'static; +} + +impl StaticTy for () { + type Item<'a> = &'a (); + //~^ ERROR the type `&'a ()` does not fulfill the required lifetime +} + +fn main() {} |