summaryrefslogtreecommitdiff
path: root/object.c
diff options
context:
space:
mode:
author卜部昌平 <shyouhei@ruby-lang.org>2020-07-27 14:54:46 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2022-01-03 22:33:38 +0900
commit980bf94f022116308fb7f95f697a85dc24f5884a (patch)
treed8aba1ceefd60650a4087fa822aea78c48be3133 /object.c
parent3ff762cc7c40a6422264cf978edfe6a0940070f1 (diff)
Kernel#=~: delete
Has been deprecated since ebff9dc10e6e72239c23e50acc7d3cbfdc659e7a.
Diffstat (limited to 'object.c')
-rw-r--r--object.c24
1 files changed, 2 insertions, 22 deletions
diff --git a/object.c b/object.c
index 49315c566c..2c9cbe7403 100644
--- a/object.c
+++ b/object.c
@@ -1214,6 +1214,8 @@ nil_inspect(VALUE obj)
* nil =~ other -> nil
*
* Dummy pattern matching -- always returns nil.
+ *
+ * This method makes it possible to `while gets =~ /re/ do`.
*/
static VALUE
@@ -1393,27 +1395,6 @@ rb_false(VALUE obj)
return Qfalse;
}
-
-/*
- * call-seq:
- * obj =~ other -> nil
- *
- * This method is deprecated.
- *
- * This is not only useless but also troublesome because it may hide a
- * type error.
- */
-
-static VALUE
-rb_obj_match(VALUE obj1, VALUE obj2)
-{
- if (rb_warning_category_enabled_p(RB_WARN_CATEGORY_DEPRECATED)) {
- rb_category_warn(RB_WARN_CATEGORY_DEPRECATED, "deprecated Object#=~ is called on %"PRIsVALUE
- "; it always returns nil", rb_obj_class(obj1));
- }
- return Qnil;
-}
-
/*
* call-seq:
* obj !~ other -> true or false
@@ -4444,7 +4425,6 @@ InitVM_Object(void)
rb_define_method(rb_mKernel, "nil?", rb_false, 0);
rb_define_method(rb_mKernel, "===", case_equal, 1);
- rb_define_method(rb_mKernel, "=~", rb_obj_match, 1);
rb_define_method(rb_mKernel, "!~", rb_obj_not_match, 1);
rb_define_method(rb_mKernel, "eql?", rb_obj_equal, 1);
rb_define_method(rb_mKernel, "hash", rb_obj_hash, 0); /* in hash.c */