summaryrefslogtreecommitdiff
path: root/hash.c
diff options
context:
space:
mode:
Diffstat (limited to 'hash.c')
-rw-r--r--hash.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/hash.c b/hash.c
index 1fa40b1bba..4442f785f7 100644
--- a/hash.c
+++ b/hash.c
@@ -27,12 +27,12 @@
# endif
#endif
-#define HAS_MISC_ATTRIBUTES(hash, klass) ( \
+#define HAS_EXTRA_STATES(hash, klass) ( \
(klass = rb_obj_class(hash)) != rb_cHash || \
(klass = 0, \
- FL_TEST((hash), FL_EXIVAR|FL_TAINT|HASH_PROC_DEFAULT) || \
+ FL_TEST((hash), FL_EXIVAR|FL_TAINT|HASH_PROC_DEFAULT) || \
!NIL_P(RHASH_IFNONE(hash))))
-#define HASH_REJECT_COPY_MISC_ATTRIBUTES 1
+#define HASH_REJECT_COPY_EXTRA_STATES 1
static VALUE rb_hash_s_try_convert(VALUE, VALUE);
@@ -1133,11 +1133,11 @@ rb_hash_reject(VALUE hash)
RETURN_SIZED_ENUMERATOR(hash, 0, 0, hash_enum_size);
if (RTEST(ruby_verbose)) {
VALUE klass;
- if (HAS_MISC_ATTRIBUTES(hash, klass)) {
-#if HASH_REJECT_COPY_MISC_ATTRIBUTES
- rb_warn("copying unguaranteed attributes: %+"PRIsVALUE, hash);
- rb_warn("following atributes will not be copied in the future version:");
- if (klass != rb_cHash) {
+ if (HAS_EXTRA_STATES(hash, klass)) {
+#if HASH_REJECT_COPY_EXTRA_STATES
+ rb_warn("copying extra states: %+"PRIsVALUE, hash);
+ rb_warn("following states will not be copied in the future version:");
+ if (klass) {
rb_warn(" subclass: %+"PRIsVALUE, klass);
}
if (FL_TEST(hash, FL_EXIVAR)) {
@@ -1153,8 +1153,7 @@ rb_hash_reject(VALUE hash)
else if (!NIL_P(RHASH_IFNONE(hash)))
rb_warn(" default value: %+"PRIsVALUE, RHASH_IFNONE(hash));
#else
- rb_warn("unguaranteed attributes are not copied: %+"PRIsVALUE, hash);
- rb_warn("following atributes are ignored now:");
+ rb_warn("extra states are no longer copied: %+"PRIsVALUE, hash);
#endif
}
}