]> git.proxmox.com Git - rustc.git/blame - src/test/ui/type-alias-impl-trait/generic_type_does_not_live_long_enough.rs
New upstream version 1.55.0+dfsg1
[rustc.git] / src / test / ui / type-alias-impl-trait / generic_type_does_not_live_long_enough.rs
CommitLineData
6a06907d
XL
1// revisions: min_tait full_tait
2#![feature(min_type_alias_impl_trait)]
3#![cfg_attr(full_tait, feature(type_alias_impl_trait))]
4//[full_tait]~^ WARN incomplete
0531ce1d 5
a7813a04 6fn main() {
8faf50e0
XL
7 let y = 42;
8 let x = wrong_generic(&y);
9 let z: i32 = x; //~ ERROR mismatched types
10}
0531ce1d 11
416331ca 12type WrongGeneric<T> = impl 'static;
8faf50e0 13//~^ ERROR the parameter type `T` may not live long enough
29967ef6 14//~| ERROR: at least one trait must be specified
0531ce1d 15
8faf50e0
XL
16fn wrong_generic<T>(t: T) -> WrongGeneric<T> {
17 t
54a0048b 18}