diff options
author | Kazuki Tsujimoto <kazuki@callcc.net> | 2022-02-19 18:45:49 +0900 |
---|---|---|
committer | Kazuki Tsujimoto <kazuki@callcc.net> | 2022-02-19 18:45:49 +0900 |
commit | db6b23c76cbc7888cd9a9912790c2068703afdd0 (patch) | |
tree | 0730de840fbcacb2b2c24fb368b6647d69cefe70 | |
parent | 3200d97e95e5d84483b3df46dc54448a82820b9d (diff) | |
download | ruby-db6b23c76cbc7888cd9a9912790c2068703afdd0.tar.gz |
Find pattern is no longer experimental [Feature #18585]
-rw-r--r-- | NEWS.md | 4 | ||||
-rw-r--r-- | parse.y | 3 | ||||
-rw-r--r-- | test/ruby/test_pattern_matching.rb | 20 |
3 files changed, 4 insertions, 23 deletions
@@ -45,6 +45,9 @@ Note that each entry is kept to a minimum, see links for details. [[Bug #15928]] +* Find pattern is no longer experimental. + [[Feature #18585]] + ## Command line options ## Core classes updates @@ -164,3 +167,4 @@ The following deprecated APIs are removed. [Bug #17545]: https://bugs.ruby-lang.org/issues/17545 [Feature #17881]: https://bugs.ruby-lang.org/issues/17881 [Feature #18351]: https://bugs.ruby-lang.org/issues/18351 +[Feature #18585]: https://bugs.ruby-lang.org/issues/18585 @@ -4356,9 +4356,6 @@ p_args_tail : p_rest p_find : p_rest ',' p_args_post ',' p_rest { $$ = new_find_pattern_tail(p, $1, $3, $5, &@$); - - if (rb_warning_category_enabled_p(RB_WARN_CATEGORY_EXPERIMENTAL)) - rb_warn0L_experimental(nd_line($$), "Find pattern is experimental, and the behavior may change in future versions of Ruby!"); } ; diff --git a/test/ruby/test_pattern_matching.rb b/test/ruby/test_pattern_matching.rb index 35c41eb8b6..7531466f91 100644 --- a/test/ruby/test_pattern_matching.rb +++ b/test/ruby/test_pattern_matching.rb @@ -1,8 +1,6 @@ # frozen_string_literal: true require 'test/unit' -experimental, Warning[:experimental] = Warning[:experimental], false # suppress "warning: Pattern matching is experimental, and the behavior may change in future versions of Ruby!" -eval "\n#{<<~'END_of_GUARD'}", binding, __FILE__, __LINE__ class TestPatternMatching < Test::Unit::TestCase class NullFormatter def message_for(corrections) @@ -1550,22 +1548,6 @@ END assert_equal false, (1 in 2) end - def assert_experimental_warning(code) - w = Warning[:experimental] - - Warning[:experimental] = false - assert_warn('') {eval(code)} - - Warning[:experimental] = true - assert_warn(/is experimental/) {eval(code)} - ensure - Warning[:experimental] = w - end - - def test_experimental_warning - assert_experimental_warning("case [0]; in [*, 0, *]; end") - end - ################################################################ def test_single_pattern_error_value_pattern @@ -1693,5 +1675,3 @@ END end end end -END_of_GUARD -Warning[:experimental] = experimental |