about summary refs log tree commit diff
path: root/tests/ui/nll/ty-outlives/impl-trait-captures.rs
blob: 57e2eb24cc17928ec7efcaa5cf9a2403d91cc7b0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
//@ compile-flags:-Zverbose-internals

#![allow(warnings)]

trait Foo<'a> {
}

impl<'a, T> Foo<'a> for T { }

fn foo<'a, T>(x: &T) -> impl Foo<'a> {
    x
    //~^ ERROR captures lifetime that does not appear in bounds
}

fn main() {}