]> git.lizzy.rs Git - rust.git/blob - src/test/ui/impl-trait/type_parameters_captured.rs
Rollup merge of #98441 - calebzulawski:simd_as, r=oli-obk
[rust.git] / src / test / ui / impl-trait / type_parameters_captured.rs
1 use std::fmt::Debug;
2
3 trait Any {}
4 impl<T> Any for T {}
5
6 // Check that type parameters are captured and not considered 'static
7 fn foo<T>(x: T) -> impl Any + 'static {
8     x
9     //~^ ERROR the parameter type `T` may not live long enough
10 }
11
12 fn main() {}