sapling/eden/fs/fuse/privhelper
Marshall Cline dfac9dda4a use rvalue-qual Future::ensure(): pass 2
Summary:
This is part of "the great r-valuification of folly::Future":

* This is something we should do for safety in general.
* Several of folly::Future's methods are lvalue-qualified even though they act as though they are rvalue-qualified, that is, they provide a postcondition that says, in effect, callers should act as though the method invalidated its `this` object (regardless of whether that invalidation was actual or logical).
* This violates the C++ principle to "Express ideas directly in code" (see Core Guidelines), and generally makes it more confusing for callers as well as hiding the actual semantics from tools (linters, compilers, etc.).
* This dichotomy and confusion has manifested itself by some failures around D7840699 since lvalue-qualification hides that operation's move-out semantics - leads to some use of future operations that are really not correct, but are not obviously incorrect.
* The goal of rvalueification is to make sure methods that are logically rvalue-qualified are actually rvalue-qualified, which forces callsites to acknowledge that rvalueification, e.g., `std::move(f).ensure(...)` instead of `f.ensure(...)`. This syntactic change in the callsites forces callers to acknowledge the method's rvalue semantics.

This diff started as a Codemod, then required manual fixes. Here were the codemod steps:

* expr.ensure(...) ==> std::move(expr).ensure(...)  // if expr is not already an xvalue
* expr->ensure(...) ==> std::move(*expr).ensure(...)

Note: operator precedence of that last step is safe - no need to parenthesize `expr`. Reason: `->` binds more tightly than unary `*`.

Reviewed By: yfeldblum

Differential Revision: D9332070

fbshipit-source-id: 882121fe82c05fdb196ce676db686b6bc254974b
2018-08-16 20:37:45 -07:00
..
test Future<T>::then 6/n: Future<T>::then() & -> Future<T>::then() &&. 2018-08-03 23:36:16 -07:00
CMakeLists.txt do not require SELinux in GitHub build 2018-07-27 13:22:57 -07:00
PrivHelper.cpp use rvalue-qual Future::ensure(): pass 2 2018-08-16 20:37:45 -07:00
PrivHelper.h add a privhelper call to set the log file 2018-06-18 17:22:18 -07:00
PrivHelperConn.cpp add a privhelper call to set the log file 2018-06-18 17:22:18 -07:00
PrivHelperConn.h add a privhelper call to set the log file 2018-06-18 17:22:18 -07:00
PrivHelperServer.cpp fork the privhelper process at the very start of main() 2018-06-18 17:22:18 -07:00
PrivHelperServer.h fork the privhelper process at the very start of main() 2018-06-18 17:22:18 -07:00
UserInfo.cpp hide setcon() failure messages at startup by default 2018-08-15 13:52:06 -07:00
UserInfo.h don't swallow sudo's stdout and stderr in eden daemon 2018-03-14 12:46:19 -07:00