Skip to content

Add missing core instance methods - #3220

Merged
ksss merged 1 commit into
ruby:masterfrom
zonuexe:add-missing-instance-methods
Oct 11, 2026
Merged

ksss merged 1 commit into
ruby:masterfrom
zonuexe:add-missing-instance-methods

Conversation

@zonuexe

@zonuexe zonuexe commented Oct 11, 2026

Copy link
Copy Markdown
Contributor

Adds signatures for public C-defined instance methods of Ruby 4.0 that had no signature in core/. Doc comments are generated by rbs annotate from the RDoc of v4.0.7.

Ruby Method Change C function
Binding#implicit_parameter_defined? Added bind_implicit_parameter_defined_p
Binding#implicit_parameter_get Added bind_implicit_parameter_get
Binding#implicit_parameters Added bind_implicit_parameters
IO#external_encoding Added. nil for a write stream without an encoding rb_io_external_encoding
IO#to_path Added as an alias of #path rb_io_path
IO#wait_priority Added. Same type as #wait_readable io_wait_priority
Process::Tms#cstime Added Struct member
Process::Tms#cstime= Added Struct member
Process::Tms#cutime Added Struct member
Process::Tms#cutime= Added Struct member
Process::Tms#stime Added Struct member
Process::Tms#stime= Added Struct member
Process::Tms#utime Added Struct member
Process::Tms#utime= Added Struct member
Thread#set_trace_func Added thread_set_trace_func_m

The Process::Tms accessors are Struct members created by rb_struct_define_under at process.c#L9606.

Not covered: the remaining IO::Buffer instance methods (#each, #values, …) and Method#box.

Add signatures for public instance methods that are defined in Ruby 4.0
but were missing from core/:

- Binding#implicit_parameter_defined?, #implicit_parameter_get,
  #implicit_parameters
- IO#external_encoding, IO#to_path, IO#wait_priority
- Process::Tms#utime, #stime, #cutime, #cstime and their setters
- Thread#set_trace_func
Comment thread core/thread.rbs
# Establishes *proc* on *thr* as the handler for tracing, or disables tracing if
# the parameter is `nil`.
#
# See Kernel#set_trace_func.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about adding Kernel#set_trace_func as well?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 #3221

@ksss
ksss added this pull request to the merge queue Oct 11, 2026
Merged via the queue into ruby:master with commit dc8519e Oct 11, 2026
25 checks passed
@zonuexe
zonuexe deleted the add-missing-instance-methods branch October 11, 2026 08:00
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