diff options
author | Jeremy Evans <code@jeremyevans.net> | 2020-09-28 10:10:31 -0700 |
---|---|---|
committer | Jeremy Evans <code@jeremyevans.net> | 2020-12-18 09:54:11 -0800 |
commit | 05313c914b29f7027b27a91021ae2662f0149e54 (patch) | |
tree | 5c0b7276204a8ab9166befc9092cd45871a05aed /string.c | |
parent | 6ced55b07cf00e4ce8ffac5762f10e8ff1ecc59b (diff) |
Use category: :deprecated in warnings that are related to deprecation
Also document that both :deprecated and :experimental are supported
:category option values.
The locations where warnings were marked as deprecation warnings
was previously reviewed by shyouhei.
Comment a couple locations where deprecation warnings should probably
be used but are not currently used because deprecation warning
enablement has not occurred at the time they are called
(RUBY_FREE_MIN, RUBY_HEAP_MIN_SLOTS, -K).
Add assert_deprecated_warn to test assertions. Use this to simplify
some tests, and fix failing tests after marking some warnings with
deprecated category.
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/3917
Diffstat (limited to 'string.c')
-rw-r--r-- | string.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -8187,7 +8187,7 @@ rb_str_split_m(int argc, VALUE *argv, VALUE str) rb_raise(rb_eTypeError, "value of $; must be String or Regexp"); } else { - rb_warn("$; is set to non-nil value"); + rb_category_warn(RB_WARN_CATEGORY_DEPRECATED, "$; is set to non-nil value"); } if (split_type != SPLIT_TYPE_AWK) { switch (BUILTIN_TYPE(spat)) { @@ -8413,7 +8413,7 @@ get_rs(void) (!RB_TYPE_P(rs, T_STRING) || RSTRING_LEN(rs) != 1 || RSTRING_PTR(rs)[0] != '\n')) { - rb_warn("$/ is set to non-default value"); + rb_category_warn(RB_WARN_CATEGORY_DEPRECATED, "$/ is set to non-default value"); } return rs; } |