diff options
Diffstat (limited to '')
-rw-r--r-- | tests/ui/impl-trait/in-trait/unconstrained-lt.rs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/ui/impl-trait/in-trait/unconstrained-lt.rs b/tests/ui/impl-trait/in-trait/unconstrained-lt.rs new file mode 100644 index 000000000..f966be43a --- /dev/null +++ b/tests/ui/impl-trait/in-trait/unconstrained-lt.rs @@ -0,0 +1,16 @@ +// [next] compile-flags: -Zlower-impl-trait-in-trait-to-assoc-ty +// revisions: current next + +#![feature(return_position_impl_trait_in_trait)] + +trait Foo { + fn test() -> impl Sized; +} + +impl<'a, T> Foo for T { + //~^ ERROR the lifetime parameter `'a` is not constrained by the impl trait, self type, or predicates + + fn test() -> &'a () { &() } +} + +fn main() {} |