1
Fork 0

Error on unconstrained lifetime in RPITIT

This commit is contained in:
Michael Goulet 2023-06-14 05:20:31 +00:00
parent 6330daade9
commit bc78d0cbf1
12 changed files with 188 additions and 102 deletions

View file

@ -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() {}