summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKazuki Tsujimoto <kazuki@callcc.net>2022-02-19 18:45:49 +0900
committerKazuki Tsujimoto <kazuki@callcc.net>2022-02-19 18:45:49 +0900
commitdb6b23c76cbc7888cd9a9912790c2068703afdd0 (patch)
tree0730de840fbcacb2b2c24fb368b6647d69cefe70
parent3200d97e95e5d84483b3df46dc54448a82820b9d (diff)
Find pattern is no longer experimental [Feature #18585]
-rw-r--r--NEWS.md4
-rw-r--r--parse.y3
-rw-r--r--test/ruby/test_pattern_matching.rb20
3 files changed, 4 insertions, 23 deletions
diff --git a/NEWS.md b/NEWS.md
index 62f1786d92..ef03a6c18a 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -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
diff --git a/parse.y b/parse.y
index 0d2ccaaf03..41a09e79fe 100644
--- a/parse.y
+++ b/parse.y
@@ -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