]> git.proxmox.com Git - rustc.git/blob - src/test/ui/suggestions/fn-ctor-passed-as-arg-where-it-should-have-been-called.rs
New upstream version 1.41.1+dfsg1
[rustc.git] / src / test / ui / suggestions / fn-ctor-passed-as-arg-where-it-should-have-been-called.rs
1 // edition:2018
2 trait T {
3 type O;
4 }
5
6 struct S;
7
8 impl T for S {
9 type O = ();
10 }
11
12 fn foo() -> impl T<O=()> { S }
13
14 fn bar(f: impl T<O=()>) {}
15
16 fn main() {
17 bar(foo); //~ERROR E0277
18 let closure = || S;
19 bar(closure); //~ERROR E0277
20 }