@@ -333,6 +333,16 @@ class FOLLY_NODISCARD SafeTaskWithExecutor final
333333
334334 public:
335335 using folly_private_safe_alias_t = safe_alias_constant<ArgSafety>;
336+
337+ [[deprecated(
338+ " `asUnsafe()` is an provided as escape hatch for interoperating with "
339+ " older futures-based code, or other places not yet compatible with "
340+ " true structured concurrency patterns. Beware, the full `Task` API "
341+ " abounds with footguns like `start()` and `semi()` -- including UB, "
342+ " leaks, and lost errors." )]]
343+ TaskWithExecutor<T> asUnsafe () && {
344+ return std::move (*this ).unwrapTaskWithExecutor ();
345+ }
336346};
337347
338348template <safe_alias ArgSafety, typename T>
@@ -359,6 +369,16 @@ class FOLLY_CORO_TASK_ATTRS SafeTask final
359369 public:
360370 using detail::SafeTaskBaseTraits<ArgSafety, T>::type::type;
361371 using folly_private_safe_alias_t = safe_alias_constant<ArgSafety>;
372+
373+ [[deprecated(
374+ " `asUnsafe()` is an provided as escape hatch for interoperating with "
375+ " older futures-based code, or other places not yet compatible with "
376+ " true structured concurrency patterns. Beware, the full `Task` API "
377+ " abounds with footguns like `start()` and `semi()` -- including UB, "
378+ " leaks, and lost errors." )]]
379+ Task<T> asUnsafe () && {
380+ return std::move (*this ).unwrapTask ();
381+ }
362382};
363383
364384template <safe_alias Safety, typename T>
0 commit comments