From 31110d820cc1258cbc84b46ecc65b254c7d5529a Mon Sep 17 00:00:00 2001 From: Kenichi Kamiya Date: Sun, 3 Nov 2019 09:24:55 +0900 Subject: Improve warning message https://github.com/ruby/ruby/pull/2637#discussion_r341812475 --- re.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 're.c') diff --git a/re.c b/re.c index 6b8eda4df8..34880a849c 100644 --- a/re.c +++ b/re.c @@ -3324,7 +3324,7 @@ rb_reg_match_m(int argc, VALUE *argv, VALUE re) } if (NIL_P(str)) { - rb_warn("given argument is nil"); + rb_warn("given argument is nil; this will raise a TypeError in the next release"); } pos = reg_match_pos(re, &str, pos); if (pos < 0) { @@ -3372,7 +3372,7 @@ rb_reg_match_p(VALUE re, VALUE str, long pos) int tmpreg; if (NIL_P(str)) { - rb_warn("given argument is nil"); + rb_warn("given argument is nil; this will raise a TypeError in the next release"); return Qfalse; } str = SYMBOL_P(str) ? rb_sym2str(str) : StringValue(str); -- cgit v1.2.3