summaryrefslogtreecommitdiffstats
path: root/src/test/ui/impl-trait/type_parameters_captured.rs
blob: 81ee7d3f8a561dc5436d1d4b32990348b3fc58fa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
use std::fmt::Debug;

trait Any {}
impl<T> Any for T {}

// Check that type parameters are captured and not considered 'static
fn foo<T>(x: T) -> impl Any + 'static {
    x
    //~^ ERROR the parameter type `T` may not live long enough
}

fn main() {}