Error on unconstrained lifetime in RPITIT
This commit is contained in:
parent
6330daade9
commit
bc78d0cbf1
12 changed files with 188 additions and 102 deletions
16
tests/ui/impl-trait/in-trait/unconstrained-lt.rs
Normal file
16
tests/ui/impl-trait/in-trait/unconstrained-lt.rs
Normal 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() {}
|
Loading…
Add table
Add a link
Reference in a new issue