mirror of
https://github.com/ruby/ruby.git
synced 2025-08-16 05:59:00 +02:00
Revert "Warn it
only with -W:deprecated"
This reverts commit5458252bb0
. Revert "Fallback rb_warn_deprecated for UNIVERSAL_PARSER" This reverts commit680be886f4
. matz actually preferred always warning `it`.
This commit is contained in:
parent
680be886f4
commit
c6eb355e04
1 changed files with 1 additions and 3 deletions
4
parse.y
4
parse.y
|
@ -44,8 +44,6 @@
|
||||||
#define rb_str_coderange_scan_restartable p->config->str_coderange_scan_restartable
|
#define rb_str_coderange_scan_restartable p->config->str_coderange_scan_restartable
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define rb_warn_deprecated(fmt, suggest) rb_warn0(fmt " is deprecated; use " suggest " instead")
|
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
#include "internal.h"
|
#include "internal.h"
|
||||||
|
@ -12790,7 +12788,7 @@ gettable(struct parser_params *p, ID id, const YYLTYPE *loc)
|
||||||
if (dyna_in_block(p) && id == rb_intern("it")
|
if (dyna_in_block(p) && id == rb_intern("it")
|
||||||
&& !(DVARS_TERMINAL_P(p->lvtbl->args) || DVARS_TERMINAL_P(p->lvtbl->args->prev))
|
&& !(DVARS_TERMINAL_P(p->lvtbl->args) || DVARS_TERMINAL_P(p->lvtbl->args->prev))
|
||||||
&& p->max_numparam != ORDINAL_PARAM) {
|
&& p->max_numparam != ORDINAL_PARAM) {
|
||||||
rb_warn_deprecated("calling `it` without arguments in a block", "it() or self.it");
|
rb_warn0("`it` calls without arguments will refer to the first block param in Ruby 3.4; use it() or self.it");
|
||||||
}
|
}
|
||||||
return NEW_VCALL(id, loc);
|
return NEW_VCALL(id, loc);
|
||||||
case ID_GLOBAL:
|
case ID_GLOBAL:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue