From 05313c914b29f7027b27a91021ae2662f0149e54 Mon Sep 17 00:00:00 2001 From: Jeremy Evans Date: Mon, 28 Sep 2020 10:10:31 -0700 Subject: 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. --- re.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 're.c') diff --git a/re.c b/re.c index 2af617ea81..a56b483513 100644 --- a/re.c +++ b/re.c @@ -3467,7 +3467,7 @@ rb_reg_initialize_m(int argc, VALUE *argv, VALUE self) flags |= ARG_ENCODING_NONE; } else { - rb_warn("encoding option is ignored - %s", kcode); + rb_category_warn(RB_WARN_CATEGORY_DEPRECATED, "encoding option is ignored - %s", kcode); } } str = StringValue(argv[0]); @@ -3922,14 +3922,14 @@ rb_reg_regsub(VALUE str, VALUE src, struct re_registers *regs, VALUE regexp) static VALUE ignorecase_getter(ID _x, VALUE *_y) { - rb_warn("variable $= is no longer effective"); + rb_category_warn(RB_WARN_CATEGORY_DEPRECATED, "variable $= is no longer effective"); return Qfalse; } static void ignorecase_setter(VALUE val, ID id, VALUE *_) { - rb_warn("variable $= is no longer effective; ignored"); + rb_category_warn(RB_WARN_CATEGORY_DEPRECATED, "variable $= is no longer effective; ignored"); } static VALUE -- cgit v1.2.3