]> git.lizzy.rs Git - rust.git/blob - src/test/ui/type-alias-impl-trait/issue-85113.rs
Loop over all opaque types instead of looking at just the first one with the same...
[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     //~^ ERROR: concrete type differs from previous defining opaque type use
16     let out: OpaqueOutputImpl<'a> = arg;
17     arg
18 }
19
20 fn main() {
21     let s = String::from("wassup");
22     cool_fn(&s);
23 }