]> git.lizzy.rs Git - rust.git/blob - src/test/ui/lazy-type-alias-impl-trait/branches3.rs
Auto merge of #99292 - Aaron1011:stability-use-tree, r=cjgillot
[rust.git] / src / test / ui / lazy-type-alias-impl-trait / branches3.rs
1 #![feature(type_alias_impl_trait)]
2
3 type Foo = impl for<'a> FnOnce(&'a str) -> usize;
4 type Bar = impl FnOnce(&'static str) -> usize;
5
6 fn foo() -> Foo {
7     if true {
8         |s| s.len() //~ ERROR type annotations needed
9     } else {
10         panic!()
11     }
12 }
13 fn bar() -> Bar {
14     if true {
15         |s| s.len() //~ ERROR type annotations needed
16     } else {
17         panic!()
18     }
19 }
20
21 fn foo2() -> impl for<'a> FnOnce(&'a str) -> usize {
22     if true {
23         |s| s.len() //~ ERROR type annotations needed
24     } else {
25         panic!()
26     }
27 }
28 fn bar2() -> impl FnOnce(&'static str) -> usize {
29     if true {
30         |s| s.len() //~ ERROR type annotations needed
31     } else {
32         panic!()
33     }
34 }
35
36 fn main() {}