aboutsummaryrefslogtreecommitdiffstats
path: root/ruby.c
diff options
context:
space:
mode:
authorJeremy Evans <code@jeremyevans.net>2020-09-28 10:10:31 -0700
committerJeremy Evans <code@jeremyevans.net>2020-12-18 09:54:11 -0800
commit05313c914b29f7027b27a91021ae2662f0149e54 (patch)
tree5c0b7276204a8ab9166befc9092cd45871a05aed /ruby.c
parent6ced55b07cf00e4ce8ffac5762f10e8ff1ecc59b (diff)
downloadruby-05313c914b29f7027b27a91021ae2662f0149e54.tar.gz
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.
Diffstat (limited to 'ruby.c')
-rw-r--r--ruby.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/ruby.c b/ruby.c
index aa6d4a2b9d..a19e08b798 100644
--- a/ruby.c
+++ b/ruby.c
@@ -1747,7 +1747,10 @@ process_options(int argc, char **argv, ruby_cmdline_options_t *opt)
}
if (opt->src.enc.name)
- rb_warning("-K is specified; it is for 1.8 compatibility and may cause odd behavior");
+ /* cannot set deprecated category, as enabling deprecation warnings based on flags
+ * has not happened yet.
+ */
+ rb_warning("-K is specified; it is for 1.8 compatibility and may cause odd behavior");
#if USE_MJIT
if (opt->features.set & FEATURE_BIT(jit)) {