sapling/eden/fs
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
..
config add two new configuration value for Mononoke 2018-08-15 10:51:44 -07:00
fuse use rvalue-qual Future::ensure(): pass 2 2018-08-16 20:37:45 -07:00
inodes use rvalue-qual Future::ensure(): pass 2 2018-08-16 20:37:45 -07:00
journal restructure JournalDelta and fix Watchman subscription race 2018-08-15 14:52:06 -07:00
model Added class CachedParsedFileMonitor and tests 2018-07-25 20:07:23 -07:00
rocksdb add CMake build files 2018-04-30 14:37:46 -07:00
service restructure JournalDelta and fix Watchman subscription race 2018-08-15 14:52:06 -07:00
sqlite avoid leaking the sqlite3 db if we fail to open it 2018-06-20 16:36:22 -07:00
store add some additional verification when importing empty files 2018-08-10 11:38:20 -07:00
takeover add integration tests for CLI behavior inside a stale mount 2018-07-27 18:36:55 -07:00
testharness Allow USER and HOME to be interpolated in Eden c++ code 2018-08-06 13:53:07 -07:00
utils use rvalue-qual Future::ensure(): pass 2 2018-08-16 20:37:45 -07:00
CMakeLists.txt add CMake build files 2018-04-30 14:37:46 -07:00
eden-config.h add CMake build files 2018-04-30 14:37:46 -07:00