]> git.lizzy.rs Git - rust.git/blob - src/test/ui/suggestions/fn-ctor-passed-as-arg-where-it-should-have-been-called.rs
Rollup merge of #100953 - joshtriplett:write-docs, r=Mark-Simulacrum
[rust.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 }