]> git.lizzy.rs Git - rust.git/blob - src/test/ui/type-alias-impl-trait/issue-85113.rs
Rollup merge of #86223 - fee1-dead:better-E0121, r=petrochenkov
[rust.git] / src / test / ui / type-alias-impl-trait / issue-85113.rs
1 #![feature(min_type_alias_impl_trait)]
2 #![feature(impl_trait_in_bindings)]
3 #![allow(incomplete_features)]
4
5 type OpaqueOutputImpl<'a> = impl Output<'a> + 'a;
6 //~^ ERROR: hidden type for `impl Trait` captures lifetime that does not appear in bounds
7 //~| ERROR: the type `&'<empty> str` does not fulfill the required lifetime
8 //~| ERROR: cannot infer an appropriate lifetime for lifetime parameter `'a` due to conflicting requirements
9
10 trait Output<'a> {}
11
12 impl<'a> Output<'a> for &'a str {}
13
14 fn cool_fn<'a>(arg: &'a str) -> OpaqueOutputImpl<'a> {
15     let out: OpaqueOutputImpl<'a> = arg;
16     arg
17 }
18
19 fn main() {
20     let s = String::from("wassup");
21     cool_fn(&s);
22 }