Skip to content

Make Regexp immutable (all Regexp are frozen, not just literal regexps) - #14547

Closed
eregon wants to merge 1 commit into
ruby:masterfrom
eregon:immutable_regexp
Closed

Make Regexp immutable (all Regexp are frozen, not just literal regexps)#14547
eregon wants to merge 1 commit into
ruby:masterfrom
eregon:immutable_regexp

Conversation

@eregon

@eregon eregon commented Sep 13, 2025

Copy link
Copy Markdown
Member

@eregon eregon changed the title [WIP] Make Regexp immutable (all Regexp are frozen, not just literal … [WIP] Make Regexp immutable (all Regexp are frozen, not just literal regexps) Sep 13, 2025
Comment thread spec/ruby/core/regexp/shared/new.rb Outdated
Comment thread spec/ruby/optional/capi/encoding_spec.rb
@cloudbees-smart-tests

cloudbees-smart-tests Bot commented Dec 7, 2025

Copy link
Copy Markdown

2/68747 Tests Failed

spec/ruby/core/marshal/load_spec.rb#Marshal.load for a Regexp restore the regexp instance variables
FrozenError: can't modify frozen Regexp: /hello/
D:/a/ruby/ruby/src/spec/ruby/core/marshal/shared/load.rb:951:in 'Kernel#instance_variable_set'
D:/a/ruby/ruby/src/spec/ruby/core/marshal/shared/load.rb:951:in 'block (3 levels) in <top (required)>'
D:/a/ruby/ruby/src/spec/ruby/core/marshal/load_spec.rb:4:in '<top (required)>'
spec/ruby/core/marshal/restore_spec.rb#Marshal.restore for a Regexp restore the regexp instance variables
FrozenError: can't modify frozen Regexp: /hello/
/Users/runner/work/ruby/ruby/src/spec/ruby/core/marshal/shared/load.rb:951:in 'Kernel#instance_variable_set'
/Users/runner/work/ruby/ruby/src/spec/ruby/core/marshal/shared/load.rb:951:in 'block (3 levels) in <top (required)>'
/Users/runner/work/ruby/ruby/src/spec/ruby/core/marshal/restore_spec.rb:4:in '<top (required)>'

[-> View Test suite health in main branch]

@eregon
eregon force-pushed the immutable_regexp branch 2 times, most recently from f99843b to d2c794c Compare December 7, 2025 15:15
@eregon eregon changed the title [WIP] Make Regexp immutable (all Regexp are frozen, not just literal regexps) Make Regexp immutable (all Regexp are frozen, not just literal regexps) Dec 7, 2025
@eregon
eregon marked this pull request as ready for review December 7, 2025 15:15
@eregon

eregon commented Dec 7, 2025

Copy link
Copy Markdown
Member Author

@nobu Could you review maybe?

@eregon
eregon requested a review from nobu December 10, 2025 11:30
@eregon
eregon force-pushed the immutable_regexp branch from 579b44f to c00b945 Compare March 24, 2026 15:28
@eregon eregon closed this Mar 24, 2026
@eregon

eregon commented Mar 24, 2026

Copy link
Copy Markdown
Member Author

Replaced by #16530

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants