fork/rust
git clone https://git.julia.blue/fork/rust
3bcad65fbf6
master
1error[E0277]: the trait bound `fn(Argument) -> Return {function}: Trait` is not satisfied 2 --> $DIR/issue-99875.rs:12:11 3 | 4LL | takes(function); 5 | ----- ^^^^^^^^ the trait `Trait` is not implemented for fn item `fn(Argument) -> Return {function}` 6 | | 7 | required by a bound introduced by this call 8 | 9note: required by a bound in `takes` 10 --> $DIR/issue-99875.rs:9:18 11 | 12LL | fn takes(_: impl Trait) {} 13 | ^^^^^ required by this bound in `takes` 14help: the trait `Trait` is implemented for fn pointer `fn(Argument) -> Return`, try casting using `as` 15 | 16LL | takes(function as fn(Argument) -> Return); 17 | +++++++++++++++++++++++++ 18 19error[E0277]: the trait bound `{closure@$DIR/issue-99875.rs:14:11: 14:34}: Trait` is not satisfied 20 --> $DIR/issue-99875.rs:14:11 21 | 22LL | takes(|_: Argument| -> Return { todo!() }); 23 | ----- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Trait` is not implemented for closure `{closure@$DIR/issue-99875.rs:14:11: 14:34}` 24 | | 25 | required by a bound introduced by this call 26 | 27 = help: the trait `Trait` is implemented for fn pointer `fn(Argument) -> Return` 28note: required by a bound in `takes` 29 --> $DIR/issue-99875.rs:9:18 30 | 31LL | fn takes(_: impl Trait) {} 32 | ^^^^^ required by this bound in `takes` 33 34error: aborting due to 2 previous errors 35 36For more information about this error, try `rustc --explain E0277`.