Relax constraints on closures in ExpressionParser::with_*
commit61cb9a83fa9d813dae1e7849305c29ed24aafaa3
authorLeo Osvald <leoo@fb.com>
Wed, 12 Jun 2019 20:30:49 +0000 (12 13:30 -0700)
committerHhvm Bot <hhvm-bot@users.noreply.github.com>
Wed, 12 Jun 2019 20:35:29 +0000 (12 13:35 -0700)
tree617eb2cdc46cfe4b34a570892bef825c3a91ac16
parent7cbe0466b97c591bb2fcb6c01561e2a13894c57f
Relax constraints on closures in ExpressionParser::with_*

Summary:
The current signature prevents passing in closures that mutate
or move in the captured values.  For the former FnMut would suffice,
but if we want to allow captured values to be moved in, the closure
should be passed by move.  Therefore, move in a `F: FnOnce` closure
instead of passing it by reference.

Reviewed By: shiqicao

Differential Revision: D15773613

fbshipit-source-id: b3d57e2f6a938d4b645ce90cce334edb3b26681c
hphp/hack/src/parser/declaration_parser.rs
hphp/hack/src/parser/expression_parser.rs