diff options
author | Benoit Daloze <eregontp@gmail.com> | 2022-12-20 18:10:57 +0100 |
---|---|---|
committer | Benoit Daloze <eregontp@gmail.com> | 2022-12-20 19:32:23 +0100 |
commit | d557f17974384dde4ff2da021a1b38905a39bda2 (patch) | |
tree | c9748de69b53d3f9865284ffdc3de08ee165d74c /cont.c | |
parent | 45175962a6fd74ab2e9ba92f1280f3987af25494 (diff) |
Use an experimental warning for Fiber#storage=
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/6972
Diffstat (limited to 'cont.c')
-rw-r--r-- | cont.c | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -29,6 +29,7 @@ extern int madvise(caddr_t, size_t, int); #include "gc.h" #include "internal.h" #include "internal/cont.h" +#include "internal/error.h" #include "internal/proc.h" #include "internal/sanitizers.h" #include "internal/warnings.h" @@ -2128,6 +2129,11 @@ fiber_storage_validate(VALUE value) static VALUE rb_fiber_storage_set(VALUE self, VALUE value) { + if (rb_warning_category_enabled_p(RB_WARN_CATEGORY_EXPERIMENTAL)) { + rb_category_warn(RB_WARN_CATEGORY_EXPERIMENTAL, + "Fiber#storage= is experimental and may be removed in the future!"); + } + fiber_storage_validate(value); fiber_ptr(self)->cont.saved_ec.storage = rb_obj_dup(value); |