[前][次][番号順一覧][スレッド一覧]

ruby-changes:71222

From: Kazuki <ko1@a...>
Date: Sat, 19 Feb 2022 19:06:23 +0900 (JST)
Subject: [ruby-changes:71222] db6b23c76c (master): Find pattern is no longer experimental [Feature #18585]

https://git.ruby-lang.org/ruby.git/commit/?id=db6b23c76c

From db6b23c76cbc7888cd9a9912790c2068703afdd0 Mon Sep 17 00:00:00 2001
From: Kazuki Tsujimoto <kazuki@c...>
Date: Sat, 19 Feb 2022 18:45:49 +0900
Subject: Find pattern is no longer experimental [Feature #18585]

---
 NEWS.md                            |  4 ++++
 parse.y                            |  3 ---
 test/ruby/test_pattern_matching.rb | 20 --------------------
 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. https://github.com/ruby/ruby/blob/trunk/NEWS.md#L45
 
   [[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. https://github.com/ruby/ruby/blob/trunk/NEWS.md#L167
 [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 https://github.com/ruby/ruby/blob/trunk/parse.y#L4356
 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 @@ https://github.com/ruby/ruby/blob/trunk/test/ruby/test_pattern_matching.rb#L1
 # 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 https://github.com/ruby/ruby/blob/trunk/test/ruby/test_pattern_matching.rb#L1548
     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 https://github.com/ruby/ruby/blob/trunk/test/ruby/test_pattern_matching.rb#L1675
     end
   end
 end
-END_of_GUARD
-Warning[:experimental] = experimental
-- 
cgit v1.2.1


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]