summaryrefslogtreecommitdiff
path: root/object.c
diff options
context:
space:
mode:
Diffstat (limited to 'object.c')
-rw-r--r--object.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/object.c b/object.c
index 0bb0e0f8e8..61be0d3862 100644
--- a/object.c
+++ b/object.c
@@ -1624,8 +1624,10 @@ rb_false(VALUE obj)
static VALUE
rb_obj_match(VALUE obj1, VALUE obj2)
{
- rb_warn("deprecated Object#=~ is called on %"PRIsVALUE
- "; it always returns nil", rb_obj_class(obj1));
+ if (rb_warning_category_enabled_p(RB_WARN_CATEGORY_DEPRECATED)) {
+ rb_warn("deprecated Object#=~ is called on %"PRIsVALUE
+ "; it always returns nil", rb_obj_class(obj1));
+ }
return Qnil;
}