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. --- variable.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'variable.c') diff --git a/variable.c b/variable.c index 5b430a7947..3b1462b9de 100644 --- a/variable.c +++ b/variable.c @@ -2530,10 +2530,10 @@ rb_const_warn_if_deprecated(const rb_const_entry_t *ce, VALUE klass, ID id) if (RB_CONST_DEPRECATED_P(ce) && rb_warning_category_enabled_p(RB_WARN_CATEGORY_DEPRECATED)) { if (klass == rb_cObject) { - rb_warn("constant ::%"PRIsVALUE" is deprecated", QUOTE_ID(id)); + rb_category_warn(RB_WARN_CATEGORY_DEPRECATED, "constant ::%"PRIsVALUE" is deprecated", QUOTE_ID(id)); } else { - rb_warn("constant %"PRIsVALUE"::%"PRIsVALUE" is deprecated", + rb_category_warn(RB_WARN_CATEGORY_DEPRECATED, "constant %"PRIsVALUE"::%"PRIsVALUE" is deprecated", rb_class_name(klass), QUOTE_ID(id)); } } -- cgit v1.2.3