зеркало из https://github.com/github/ruby.git
Remove old warning aged nearly 8 years
This commit is contained in:
Родитель
f96c199449
Коммит
6963f8f743
6
class.c
6
class.c
|
@ -2363,12 +2363,6 @@ rb_scan_args_kw(int kw_flag, int argc, const VALUE *argv, const char *fmt, ...)
|
|||
return rb_scan_args_result(&arg, argc);
|
||||
}
|
||||
|
||||
int
|
||||
rb_class_has_methods(VALUE c)
|
||||
{
|
||||
return rb_id_table_size(RCLASS_M_TBL(c)) == 0 ? FALSE : TRUE;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \}
|
||||
*/
|
||||
|
|
23
hash.c
23
hash.c
|
@ -52,11 +52,6 @@
|
|||
#include "gc.h"
|
||||
#endif
|
||||
|
||||
#define HAS_EXTRA_STATES(hash, klass) ( \
|
||||
((klass = has_extra_methods(rb_obj_class(hash))) != 0) || \
|
||||
FL_TEST((hash), FL_EXIVAR|RHASH_PROC_DEFAULT) || \
|
||||
!NIL_P(RHASH_IFNONE(hash)))
|
||||
|
||||
#define SET_DEFAULT(hash, ifnone) ( \
|
||||
FL_UNSET_RAW(hash, RHASH_PROC_DEFAULT), \
|
||||
RHASH_SET_IFNONE(hash, ifnone))
|
||||
|
@ -73,18 +68,6 @@ copy_default(struct RHash *hash, const struct RHash *hash2)
|
|||
RHASH_SET_IFNONE(hash, RHASH_IFNONE((VALUE)hash2));
|
||||
}
|
||||
|
||||
static VALUE
|
||||
has_extra_methods(VALUE klass)
|
||||
{
|
||||
const VALUE base = rb_cHash;
|
||||
VALUE c = klass;
|
||||
while (c != base) {
|
||||
if (rb_class_has_methods(c)) return klass;
|
||||
c = RCLASS_SUPER(c);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static VALUE rb_hash_s_try_convert(VALUE, VALUE);
|
||||
|
||||
/*
|
||||
|
@ -2608,12 +2591,6 @@ rb_hash_reject(VALUE hash)
|
|||
VALUE result;
|
||||
|
||||
RETURN_SIZED_ENUMERATOR(hash, 0, 0, hash_enum_size);
|
||||
if (RTEST(ruby_verbose)) {
|
||||
VALUE klass;
|
||||
if (HAS_EXTRA_STATES(hash, klass)) {
|
||||
rb_warn("extra states are no longer copied: %+"PRIsVALUE, hash);
|
||||
}
|
||||
}
|
||||
result = hash_dup_with_compare_by_id(hash);
|
||||
if (!RHASH_EMPTY_P(hash)) {
|
||||
rb_hash_foreach(result, delete_if_i, result);
|
||||
|
|
|
@ -127,7 +127,6 @@ VALUE rb_obj_public_methods(int argc, const VALUE *argv, VALUE obj);
|
|||
VALUE rb_special_singleton_class(VALUE);
|
||||
VALUE rb_singleton_class_clone_and_attach(VALUE obj, VALUE attach);
|
||||
VALUE rb_singleton_class_get(VALUE obj);
|
||||
int rb_class_has_methods(VALUE c);
|
||||
void rb_undef_methods_from(VALUE klass, VALUE super);
|
||||
|
||||
static inline void RCLASS_SET_ORIGIN(VALUE klass, VALUE origin);
|
||||
|
|
|
@ -2048,21 +2048,12 @@ class TestHash < Test::Unit::TestCase
|
|||
|
||||
class TestSubHash < TestHash
|
||||
class SubHash < Hash
|
||||
def reject(*)
|
||||
super
|
||||
end
|
||||
end
|
||||
|
||||
def setup
|
||||
@cls = SubHash
|
||||
super
|
||||
end
|
||||
|
||||
def test_reject
|
||||
assert_warning(/extra states are no longer copied/) do
|
||||
super
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
ruby2_keywords def get_flagged_hash(*args)
|
||||
|
|
Загрузка…
Ссылка в новой задаче