Commit f9326ade authored by Orvid King's avatar Orvid King Committed by Facebook Github Bot

Eliminate uses of FOLLY_DEPRECATED

Summary: Every compiler we currently support supports the `[[deprecated]]` attribute, so use that instead.

Reviewed By: yfeldblum, ot

Differential Revision: D7405895

fbshipit-source-id: 541c537cd7a0be0d901378c0e79f5cd0f55b85e3
parent 5d09018c
...@@ -551,7 +551,7 @@ class Range : private boost::totally_ordered<Range<Iter>> { ...@@ -551,7 +551,7 @@ class Range : private boost::totally_ordered<Range<Iter>> {
// B) If you have to use this exact function then make your own hasher // B) If you have to use this exact function then make your own hasher
// object and copy the body over (see thrift example: D3972362). // object and copy the body over (see thrift example: D3972362).
// https://github.com/facebook/fbthrift/commit/f8ed502e24ab4a32a9d5f266580 // https://github.com/facebook/fbthrift/commit/f8ed502e24ab4a32a9d5f266580
FOLLY_DEPRECATED("Replace with folly::Hash if the hash is not serialized") [[deprecated("Replace with folly::Hash if the hash is not serialized")]]
uint32_t hash() const { uint32_t hash() const {
// Taken from fbi/nstring.h: // Taken from fbi/nstring.h:
// Quick and dirty bernstein hash...fine for short ascii strings // Quick and dirty bernstein hash...fine for short ascii strings
......
...@@ -565,14 +565,14 @@ class Singleton { ...@@ -565,14 +565,14 @@ class Singleton {
// Generally your program life cycle should be fine with calling // Generally your program life cycle should be fine with calling
// get() repeatedly rather than saving the reference, and then not // get() repeatedly rather than saving the reference, and then not
// call get() during process shutdown. // call get() during process shutdown.
FOLLY_DEPRECATED("Replaced by try_get") [[deprecated("Replaced by try_get")]]
static T* get() { return getEntry().get(); } static T* get() { return getEntry().get(); }
// If, however, you do need to hold a reference to the specific // If, however, you do need to hold a reference to the specific
// singleton, you can try to do so with a weak_ptr. Avoid this when // singleton, you can try to do so with a weak_ptr. Avoid this when
// possible but the inability to lock the weak pointer can be a // possible but the inability to lock the weak pointer can be a
// signal that the vault has been destroyed. // signal that the vault has been destroyed.
FOLLY_DEPRECATED("Replaced by try_get") [[deprecated("Replaced by try_get")]]
static std::weak_ptr<T> get_weak() { return getEntry().get_weak(); } static std::weak_ptr<T> get_weak() { return getEntry().get_weak(); }
// Preferred alternative to get_weak, it returns shared_ptr that can be // Preferred alternative to get_weak, it returns shared_ptr that can be
......
...@@ -484,7 +484,7 @@ class Subprocess { ...@@ -484,7 +484,7 @@ class Subprocess {
* The shell to use is taken from the environment variable $SHELL, * The shell to use is taken from the environment variable $SHELL,
* or /bin/sh if $SHELL is unset. * or /bin/sh if $SHELL is unset.
*/ */
FOLLY_DEPRECATED("Prefer not running in a shell or use `shellify`.") [[deprecated("Prefer not running in a shell or use `shellify`.")]]
explicit Subprocess( explicit Subprocess(
const std::string& cmd, const std::string& cmd,
const Options& options = Options(), const Options& options = Options(),
......
...@@ -111,7 +111,7 @@ class Try { ...@@ -111,7 +111,7 @@ class Try {
* *
* @param ep The exception_pointer. Will be rethrown. * @param ep The exception_pointer. Will be rethrown.
*/ */
FOLLY_DEPRECATED("use Try(exception_wrapper)") [[deprecated("use Try(exception_wrapper)")]]
explicit Try(std::exception_ptr ep) explicit Try(std::exception_ptr ep)
: contains_(Contains::EXCEPTION), : contains_(Contains::EXCEPTION),
e_(exception_wrapper::from_exception_ptr(ep)) {} e_(exception_wrapper::from_exception_ptr(ep)) {}
...@@ -373,7 +373,7 @@ class Try<void> { ...@@ -373,7 +373,7 @@ class Try<void> {
* *
* @param ep The exception_pointer. Will be rethrown. * @param ep The exception_pointer. Will be rethrown.
*/ */
FOLLY_DEPRECATED("use Try(exception_wrapper)") [[deprecated("use Try(exception_wrapper)")]]
explicit Try(std::exception_ptr ep) explicit Try(std::exception_ptr ep)
: hasValue_(false), e_(exception_wrapper::from_exception_ptr(ep)) {} : hasValue_(false), e_(exception_wrapper::from_exception_ptr(ep)) {}
......
...@@ -419,8 +419,8 @@ class ValueContainerPolicy : public BasePolicy< ...@@ -419,8 +419,8 @@ class ValueContainerPolicy : public BasePolicy<
complainUnlessNothrowMove() {} complainUnlessNothrowMove() {}
template <typename T> template <typename T>
FOLLY_DEPRECATED( [[deprecated(
"use F14NodeMap/Set or mark key and mapped type move constructor nothrow") "use F14NodeMap/Set or mark key and mapped type move constructor nothrow")]]
std::enable_if_t<!std::is_nothrow_move_constructible< std::enable_if_t<!std::is_nothrow_move_constructible<
T>::value> complainUnlessNothrowMove() {} T>::value> complainUnlessNothrowMove() {}
...@@ -949,8 +949,8 @@ class VectorContainerPolicy : public BasePolicy< ...@@ -949,8 +949,8 @@ class VectorContainerPolicy : public BasePolicy<
complainUnlessNothrowMove() {} complainUnlessNothrowMove() {}
template <typename T> template <typename T>
FOLLY_DEPRECATED( [[deprecated(
"use F14NodeMap/Set or mark key and mapped type move constructor nothrow") "use F14NodeMap/Set or mark key and mapped type move constructor nothrow")]]
std::enable_if_t<!std::is_nothrow_move_constructible< std::enable_if_t<!std::is_nothrow_move_constructible<
T>::value> complainUnlessNothrowMove() {} T>::value> complainUnlessNothrowMove() {}
......
...@@ -739,19 +739,19 @@ class Future : private futures::detail::FutureBase<T> { ...@@ -739,19 +739,19 @@ class Future : private futures::detail::FutureBase<T> {
/// by then), and it is active (active by default). /// by then), and it is active (active by default).
/// ///
/// Inactive Futures will activate upon destruction. /// Inactive Futures will activate upon destruction.
FOLLY_DEPRECATED("do not use") Future<T>& activate() & { [[deprecated("do not use")]] Future<T>& activate() & {
this->core_->activate(); this->core_->activate();
return *this; return *this;
} }
FOLLY_DEPRECATED("do not use") Future<T>& deactivate() & { [[deprecated("do not use")]] Future<T>& deactivate() & {
this->core_->deactivate(); this->core_->deactivate();
return *this; return *this;
} }
FOLLY_DEPRECATED("do not use") Future<T> activate() && { [[deprecated("do not use")]] Future<T> activate() && {
this->core_->activate(); this->core_->activate();
return std::move(*this); return std::move(*this);
} }
FOLLY_DEPRECATED("do not use") Future<T> deactivate() && { [[deprecated("do not use")]] Future<T> deactivate() && {
this->core_->deactivate(); this->core_->deactivate();
return std::move(*this); return std::move(*this);
} }
......
...@@ -74,7 +74,7 @@ class Promise { ...@@ -74,7 +74,7 @@ class Promise {
p.setException(std::current_exception()); p.setException(std::current_exception());
} }
*/ */
FOLLY_DEPRECATED("use setException(exception_wrapper)") [[deprecated("use setException(exception_wrapper)")]]
void setException(std::exception_ptr const&); void setException(std::exception_ptr const&);
/** Fulfill the Promise with an exception type E, which can be passed to /** Fulfill the Promise with an exception type E, which can be passed to
......
...@@ -75,7 +75,7 @@ class SharedPromise { ...@@ -75,7 +75,7 @@ class SharedPromise {
p.setException(std::current_exception()); p.setException(std::current_exception());
} }
*/ */
FOLLY_DEPRECATED("use setException(exception_wrapper)") [[deprecated("use setException(exception_wrapper)")]]
void setException(std::exception_ptr const&); void setException(std::exception_ptr const&);
/** Fulfill the SharedPromise with an exception type E, which can be passed to /** Fulfill the SharedPromise with an exception type E, which can be passed to
......
...@@ -159,7 +159,7 @@ makeSemiFutureWith(F&& func); ...@@ -159,7 +159,7 @@ makeSemiFutureWith(F&& func);
/// ///
/// auto f = makeSemiFuture<string>(std::current_exception()); /// auto f = makeSemiFuture<string>(std::current_exception());
template <class T> template <class T>
FOLLY_DEPRECATED("use makeSemiFuture(exception_wrapper)") [[deprecated("use makeSemiFuture(exception_wrapper)")]]
SemiFuture<T> makeSemiFuture(std::exception_ptr const& e); SemiFuture<T> makeSemiFuture(std::exception_ptr const& e);
/// Make a failed SemiFuture from an exception_wrapper. /// Make a failed SemiFuture from an exception_wrapper.
...@@ -243,7 +243,7 @@ makeFutureWith(F&& func); ...@@ -243,7 +243,7 @@ makeFutureWith(F&& func);
/// ///
/// auto f = makeFuture<string>(std::current_exception()); /// auto f = makeFuture<string>(std::current_exception());
template <class T> template <class T>
FOLLY_DEPRECATED("use makeSemiFuture(exception_wrapper)") [[deprecated("use makeSemiFuture(exception_wrapper)")]]
Future<T> makeFuture(std::exception_ptr const& e); Future<T> makeFuture(std::exception_ptr const& e);
/// Make a failed Future from an exception_wrapper. /// Make a failed Future from an exception_wrapper.
......
...@@ -523,7 +523,7 @@ class SSLContext { ...@@ -523,7 +523,7 @@ class SSLContext {
*/ */
static bool matchName(const char* host, const char* pattern, int size); static bool matchName(const char* host, const char* pattern, int size);
FOLLY_DEPRECATED("Use folly::ssl::init") [[deprecated("Use folly::ssl::init")]]
static void initializeOpenSSL(); static void initializeOpenSSL();
protected: protected:
......
...@@ -81,9 +81,9 @@ constexpr detail::ShellCmdFormat operator"" _shellify( ...@@ -81,9 +81,9 @@ constexpr detail::ShellCmdFormat operator"" _shellify(
* string is a compile-time constant which can be inspected during code reviews * string is a compile-time constant which can be inspected during code reviews
*/ */
template <typename... Arguments> template <typename... Arguments>
FOLLY_DEPRECATED( [[deprecated(
"Use `\"command {} {} ...\"_shellify(argument1, argument2 ...)` from " "Use `\"command {} {} ...\"_shellify(argument1, argument2 ...)` from "
"namespace `folly::literals::shell_literals`") "namespace `folly::literals::shell_literals`")]]
std::vector<std::string> shellify( std::vector<std::string> shellify(
StringPiece format, StringPiece format,
Arguments&&... arguments) { Arguments&&... arguments) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment