rbs 4.0.0.dev.1 → 4.0.0.dev.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (64) hide show
  1. checksums.yaml +4 -4
  2. data/.clang-format +74 -0
  3. data/.clangd +2 -0
  4. data/.github/workflows/c-check.yml +51 -0
  5. data/.github/workflows/dependabot.yml +1 -1
  6. data/.github/workflows/ruby.yml +28 -17
  7. data/.github/workflows/typecheck.yml +0 -2
  8. data/.gitignore +4 -0
  9. data/.rubocop.yml +1 -1
  10. data/.vscode/extensions.json +5 -0
  11. data/.vscode/settings.json +19 -0
  12. data/README.md +37 -0
  13. data/Rakefile +90 -0
  14. data/config.yml +1 -1
  15. data/core/enumerable.rbs +9 -0
  16. data/core/io.rbs +4 -4
  17. data/core/thread.rbs +0 -7
  18. data/ext/rbs_extension/ast_translation.c +1010 -1074
  19. data/ext/rbs_extension/ast_translation.h +4 -0
  20. data/ext/rbs_extension/class_constants.c +78 -74
  21. data/ext/rbs_extension/class_constants.h +4 -0
  22. data/ext/rbs_extension/compat.h +10 -0
  23. data/ext/rbs_extension/extconf.rb +15 -1
  24. data/ext/rbs_extension/legacy_location.c +173 -172
  25. data/ext/rbs_extension/legacy_location.h +8 -3
  26. data/ext/rbs_extension/main.c +315 -273
  27. data/ext/rbs_extension/rbs_extension.h +3 -0
  28. data/ext/rbs_extension/rbs_string_bridging.h +4 -0
  29. data/include/rbs/ast.h +11 -12
  30. data/include/rbs/defines.h +11 -12
  31. data/include/rbs/lexer.h +108 -108
  32. data/include/rbs/location.h +14 -14
  33. data/include/rbs/parser.h +21 -19
  34. data/include/rbs/string.h +3 -3
  35. data/include/rbs/util/rbs_allocator.h +14 -14
  36. data/include/rbs/util/rbs_constant_pool.h +3 -3
  37. data/include/rbs/util/rbs_encoding.h +1 -1
  38. data/lib/rbs/environment.rb +4 -0
  39. data/lib/rbs/namespace.rb +0 -7
  40. data/lib/rbs/parser_aux.rb +5 -0
  41. data/lib/rbs/type_name.rb +0 -7
  42. data/lib/rbs/types.rb +3 -1
  43. data/lib/rbs/unit_test/convertibles.rb +1 -0
  44. data/lib/rbs/version.rb +1 -1
  45. data/sig/environment.rbs +3 -0
  46. data/sig/namespace.rbs +0 -5
  47. data/sig/parser.rbs +20 -0
  48. data/sig/typename.rbs +0 -5
  49. data/sig/types.rbs +4 -1
  50. data/src/ast.c +216 -214
  51. data/src/lexer.c +2923 -2675
  52. data/src/lexstate.c +157 -157
  53. data/src/location.c +40 -40
  54. data/src/parser.c +2591 -2586
  55. data/src/string.c +2 -2
  56. data/src/util/rbs_allocator.c +7 -9
  57. data/src/util/rbs_assert.c +9 -9
  58. data/src/util/rbs_constant_pool.c +5 -7
  59. data/src/util/rbs_encoding.c +20095 -4056
  60. data/src/util/rbs_unescape.c +33 -32
  61. data/stdlib/json/0/json.rbs +9 -43
  62. data/stdlib/ripper/0/ripper.rbs +3 -0
  63. data/stdlib/socket/0/addrinfo.rbs +2 -2
  64. metadata +8 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d0f208999624a32e97044b8427ec19fa233e21a530a6383efe4ea5b9333ab1ce
4
- data.tar.gz: d03954e5a4fa29a428085183a90a86b481849b0994e0d454cccca395412a31f0
3
+ metadata.gz: 8e5b2060cc5ad02487c340bb1929f2bb37208e0222d949cc19d7f9dc4ed5898f
4
+ data.tar.gz: 4e3e4af4a4e4b107794984e04fd73b34812364f8526b05c2f38fcf30ec05213c
5
5
  SHA512:
6
- metadata.gz: 56da6e8a6a9336ae251d766b85c0d8ab62b42a8df1f1c828cd8f0c0ce898ac639a024c5b819e2e6a85733fa1d140ca5b06fc61de62b36fdb21074d34710bb003
7
- data.tar.gz: de3ac4191be3ec60ab8bd25c4653cc2663effc2004c9d5e33d9fbb6eabace99fa883dfd5201d92c7f574d8730a74116867a853cb525343a639aeef6d0dd6d041
6
+ metadata.gz: eb626cd71636d7f5a7cdd74e3382aa1d19f1f2c13a7c6ff794ed4f2388acc36a87ae54ecc3d722c33ecb7eeade494d2394c8151e1af88c06973a659f4ce509cf
7
+ data.tar.gz: 2dc1084d7a986fab97e206e4fda8231bad922faa3bf3b9caa201ed67c2ac7a83e0215db3a1ad97f9c41ed7d34f6e62db44204586ccb8dbfd70e067082c65642f
data/.clang-format ADDED
@@ -0,0 +1,74 @@
1
+ ---
2
+ Language: Cpp
3
+
4
+ # Indentation
5
+ UseTab: Never
6
+ IndentWidth: 4
7
+ BreakBeforeBraces: Attach
8
+ IndentCaseLabels: false
9
+ NamespaceIndentation: None
10
+ ContinuationIndentWidth: 4
11
+ IndentPPDirectives: None
12
+ IndentWrappedFunctionNames: false
13
+ AccessModifierOffset: -2
14
+
15
+ # Alignment
16
+ AlignAfterOpenBracket: BlockIndent
17
+ AlignConsecutiveAssignments: false
18
+ AlignConsecutiveDeclarations: false
19
+ AlignConsecutiveMacros: false
20
+ AlignEscapedNewlines: Left
21
+ AlignOperands: false
22
+ AlignTrailingComments: true
23
+ DerivePointerAlignment: false
24
+ PointerAlignment: Right
25
+
26
+ # Function calls formatting
27
+ BinPackArguments: false
28
+ BinPackParameters: false
29
+ AllowAllArgumentsOnNextLine: false
30
+ ExperimentalAutoDetectBinPacking: false
31
+ PenaltyBreakBeforeFirstCallParameter: 1
32
+ AlwaysBreakAfterDefinitionReturnType: None
33
+
34
+ # Wrapping and Breaking
35
+ ColumnLimit: 0
36
+ AllowShortBlocksOnASingleLine: Never
37
+ AllowShortCaseLabelsOnASingleLine: false
38
+ AllowShortFunctionsOnASingleLine: All
39
+ AllowShortIfStatementsOnASingleLine: Always
40
+ AllowShortLoopsOnASingleLine: false
41
+ AlwaysBreakAfterReturnType: None
42
+ AlwaysBreakBeforeMultilineStrings: false
43
+ AlwaysBreakTemplateDeclarations: No
44
+ BreakBeforeBinaryOperators: None
45
+ BreakBeforeTernaryOperators: false
46
+ BreakConstructorInitializers: BeforeColon
47
+ BreakInheritanceList: BeforeColon
48
+ BreakStringLiterals: false
49
+ CompactNamespaces: false
50
+ ConstructorInitializerAllOnOneLineOrOnePerLine: false
51
+ Cpp11BracedListStyle: false
52
+ ReflowComments: false
53
+ SortIncludes: Never
54
+
55
+ # Spaces
56
+ SpaceAfterCStyleCast: true
57
+ SpaceAfterLogicalNot: false
58
+ SpaceAfterTemplateKeyword: true
59
+ SpaceBeforeAssignmentOperators: true
60
+ SpaceBeforeCpp11BracedList: true
61
+ SpaceBeforeCtorInitializerColon: true
62
+ SpaceBeforeInheritanceColon: true
63
+ SpaceBeforeParens: ControlStatements
64
+ SpaceBeforeRangeBasedForLoopColon: true
65
+ SpaceBeforeSquareBrackets: false
66
+ SpaceInEmptyBlock: false
67
+ SpaceInEmptyParentheses: false
68
+ SpacesBeforeTrailingComments: 1
69
+ SpacesInAngles: false
70
+ SpacesInCStyleCastParentheses: false
71
+ SpacesInConditionalStatement: false
72
+ SpacesInContainerLiterals: true
73
+ SpacesInParentheses: false
74
+ SpacesInSquareBrackets: false
data/.clangd ADDED
@@ -0,0 +1,2 @@
1
+ CompileFlags:
2
+ CompilationDatabase: ext/rbs_extension
@@ -0,0 +1,51 @@
1
+ name: C Code Generation and Formatting Check
2
+
3
+ on:
4
+ push:
5
+ pull_request: {}
6
+ merge_group: {}
7
+
8
+ jobs:
9
+ format-check:
10
+ runs-on: ubuntu-latest
11
+ steps:
12
+ - uses: actions/checkout@v4
13
+ - uses: ruby/setup-ruby@v1
14
+ with:
15
+ ruby-version: "3.4"
16
+ bundler-cache: none
17
+ - name: Set working directory as safe
18
+ run: git config --global --add safe.directory $(pwd)
19
+ - name: Install dependencies
20
+ run: |
21
+ sudo apt-get update
22
+ sudo apt-get install -y libdb-dev curl autoconf automake m4 libtool
23
+ - name: Install clang-format from LLVM
24
+ run: |
25
+ wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
26
+ sudo apt-add-repository "deb http://apt.llvm.org/jammy/ llvm-toolchain-jammy main"
27
+ sudo apt-get update
28
+ sudo apt-get install -y clang-format
29
+ clang-format --version
30
+ - name: Install Re2c
31
+ run: |
32
+ cd /tmp
33
+ curl -L https://github.com/skvadrik/re2c/archive/refs/tags/3.1.tar.gz > re2c-3.1.tar.gz
34
+ tar xf re2c-3.1.tar.gz
35
+ cd re2c-3.1
36
+ autoreconf -i -W all
37
+ ./configure
38
+ make
39
+ sudo make install
40
+ - name: Update rubygems & bundler
41
+ run: |
42
+ ruby -v
43
+ gem update --system
44
+ - name: bin/setup
45
+ run: |
46
+ bin/setup
47
+ - name: Check C code generation and formatting
48
+ run: |
49
+ clang-format --version
50
+ bundle exec rake lexer templates compile confirm_lexer confirm_templates
51
+ bundle exec rake format:c_check
@@ -14,7 +14,7 @@ jobs:
14
14
  if: ${{ github.event.pull_request.user.login == 'dependabot[bot]' }}
15
15
  steps:
16
16
  - name: Dependabot metadata
17
- uses: dependabot/fetch-metadata@d7267f607e9d3fb96fc2fbe83e0af444713e90b7 # v2.3.0
17
+ uses: dependabot/fetch-metadata@08eff52bf64351f401fb50d4972fa95b9f2c2d1b # v2.4.0
18
18
  id: metadata
19
19
  - name: Checkout repository
20
20
  uses: actions/checkout@v4
@@ -28,8 +28,6 @@ jobs:
28
28
  - ruby: "3.4"
29
29
  job: stdlib_test
30
30
  rubyopt: "--enable-frozen-string-literal"
31
- - ruby: "3.4"
32
- job: lexer templates compile confirm_lexer confirm_templates
33
31
  - ruby: "3.4"
34
32
  job: rubocop validate test_doc build test_generate_stdlib raap
35
33
  - ruby: "3.4"
@@ -44,23 +42,10 @@ jobs:
44
42
  bundler: none
45
43
  - name: Set working directory as safe
46
44
  run: git config --global --add safe.directory $(pwd)
47
- - name: Set up permission
48
- run: chmod -R o-w /opt/hostedtoolcache/Ruby
49
45
  - name: Install dependencies
50
46
  run: |
51
47
  sudo apt-get update
52
48
  sudo apt-get install -y libdb-dev curl autoconf automake m4 libtool python3
53
- - name: Install Re2c
54
- if: ${{ contains(matrix.job, 'lexer') }}
55
- run: |
56
- cd /tmp
57
- curl -L https://github.com/skvadrik/re2c/archive/refs/tags/3.1.tar.gz > re2c-3.1.tar.gz
58
- tar xf re2c-3.1.tar.gz
59
- cd re2c-3.1
60
- autoreconf -i -W all
61
- ./configure
62
- make
63
- sudo make install
64
49
  - name: Update rubygems & bundler
65
50
  run: |
66
51
  ruby -v
@@ -90,8 +75,6 @@ jobs:
90
75
  bundler-cache: none
91
76
  - name: Set working directory as safe
92
77
  run: git config --global --add safe.directory $(pwd)
93
- - name: Set up permission
94
- run: chmod -R o-w /opt/hostedtoolcache/Ruby
95
78
  - name: Install dependencies
96
79
  run: |
97
80
  sudo apt-get update
@@ -106,3 +89,31 @@ jobs:
106
89
  - run: bundle exec rake test:valgrind
107
90
  env:
108
91
  RUBY_FREE_AT_EXIT: 1
92
+ C99_compile:
93
+ runs-on: macos-latest
94
+ strategy:
95
+ fail-fast: false
96
+ matrix:
97
+ ruby: ['3.4', head]
98
+ steps:
99
+ - uses: actions/checkout@v4
100
+ - name: Install dependencies
101
+ run: |
102
+ brew install ruby-build
103
+ - uses: ruby/setup-ruby@v1
104
+ with:
105
+ ruby-version: ${{ matrix.ruby }}
106
+ bundler: none
107
+ - name: Set working directory as safe
108
+ run: git config --global --add safe.directory $(pwd)
109
+ - name: Update rubygems & bundler
110
+ run: |
111
+ ruby -v
112
+ gem update --system
113
+ - name: clang version
114
+ run: clang --version
115
+ - name: bin/setup
116
+ run: |
117
+ bin/setup
118
+ - run: bundle exec rake clean compile_c99
119
+
@@ -20,8 +20,6 @@ jobs:
20
20
  bundler: none
21
21
  - name: Set working directory as safe
22
22
  run: git config --global --add safe.directory $(pwd)
23
- - name: Set up permission
24
- run: chmod -R o-w /opt/hostedtoolcache/Ruby
25
23
  - name: Install dependencies
26
24
  run: |
27
25
  sudo apt-get update
data/.gitignore CHANGED
@@ -21,3 +21,7 @@ lib/**/*.dll
21
21
  doc/
22
22
 
23
23
  **/*.gem
24
+
25
+ # For clangd's editor integration
26
+ ext/rbs_extension/compile_commands.json
27
+ ext/rbs_extension/.cache
data/.rubocop.yml CHANGED
@@ -1,4 +1,4 @@
1
- require:
1
+ plugins:
2
2
  - rubocop-rubycw
3
3
  - rubocop-on-rbs
4
4
 
@@ -0,0 +1,5 @@
1
+ {
2
+ "recommendations": [
3
+ "llvm-vs-code-extensions.vscode-clangd"
4
+ ]
5
+ }
@@ -0,0 +1,19 @@
1
+ {
2
+ "clangd.onConfigChanged": "restart",
3
+ "[c]": {
4
+ "editor.formatOnSave": true,
5
+ "editor.defaultFormatter": "llvm-vs-code-extensions.vscode-clangd"
6
+ },
7
+ "[cpp]": {
8
+ "editor.formatOnSave": true,
9
+ "editor.defaultFormatter": "llvm-vs-code-extensions.vscode-clangd"
10
+ },
11
+ "[h]": {
12
+ "editor.formatOnSave": true,
13
+ "editor.defaultFormatter": "llvm-vs-code-extensions.vscode-clangd"
14
+ },
15
+ "[hpp]": {
16
+ "editor.formatOnSave": true,
17
+ "editor.defaultFormatter": "llvm-vs-code-extensions.vscode-clangd"
18
+ }
19
+ }
data/README.md CHANGED
@@ -198,6 +198,43 @@ After checking out the repo, run `bin/setup` to install dependencies. Then, run
198
198
 
199
199
  To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
200
200
 
201
+ ### C Code Formatting
202
+
203
+ This project uses `clang-format` to enforce consistent formatting of C code with a `.clang-format` configuration in the root directory.
204
+
205
+ #### Setup
206
+
207
+ First, install clang-format:
208
+
209
+ ```bash
210
+ # macOS
211
+ brew install clang-format
212
+
213
+ # Ubuntu/Debian
214
+ sudo apt-get install clang-format
215
+
216
+ # Windows
217
+ choco install llvm
218
+ ```
219
+
220
+ #### Usage
221
+
222
+ Format all C source files:
223
+
224
+ ```bash
225
+ rake format:c
226
+ ```
227
+
228
+ Check formatting without making changes:
229
+
230
+ ```bash
231
+ rake format:c_check
232
+ ```
233
+
234
+ #### Editor Integration
235
+
236
+ For VS Code users, install the "clangd" extension which will automatically use the project's `.clang-format` file.
237
+
201
238
  ## Contributing
202
239
 
203
240
  Bug reports and pull requests are welcome on GitHub at https://github.com/ruby/rbs.
data/Rakefile CHANGED
@@ -37,6 +37,7 @@ multitask :default => [:test, :stdlib_test, :typecheck_test, :rubocop, :validate
37
37
 
38
38
  task :lexer do
39
39
  sh "re2c -W --no-generation-date -o src/lexer.c src/lexer.re"
40
+ sh "clang-format -i -style=file src/lexer.c"
40
41
  end
41
42
 
42
43
  task :confirm_lexer => :lexer do
@@ -49,6 +50,84 @@ task :confirm_templates => :templates do
49
50
  sh "git diff --exit-code -- include src"
50
51
  end
51
52
 
53
+ # Task to format C code using clang-format
54
+ namespace :format do
55
+ dirs = ["src", "ext", "include"]
56
+
57
+ # Find all C source and header files
58
+ files = `find #{dirs.join(" ")} -type f \\( -name "*.c" -o -name "*.h" \\)`.split("\n")
59
+
60
+ desc "Format C source files using clang-format"
61
+ task :c do
62
+ puts "Formatting C files..."
63
+
64
+ # Check if clang-format is installed
65
+ unless system("which clang-format > /dev/null 2>&1")
66
+ abort "Error: clang-format not found. Please install clang-format first."
67
+ end
68
+
69
+ if files.empty?
70
+ puts "No C files found to format"
71
+ next
72
+ end
73
+
74
+ puts "Found #{files.length} files to format (excluding generated files)"
75
+
76
+ exit_status = 0
77
+ files.each do |file|
78
+ puts "Formatting #{file}"
79
+ unless system("clang-format -i -style=file #{file}")
80
+ puts "❌ Error formatting #{file}"
81
+ exit_status = 1
82
+ end
83
+ end
84
+
85
+ exit exit_status unless exit_status == 0
86
+ puts "✅ All files formatted successfully"
87
+ end
88
+
89
+ desc "Check if C source files are properly formatted"
90
+ task :c_check do
91
+ puts "Checking C file formatting..."
92
+
93
+ # Check if clang-format is installed
94
+ unless system("which clang-format > /dev/null 2>&1")
95
+ abort "Error: clang-format not found. Please install clang-format first."
96
+ end
97
+
98
+ if files.empty?
99
+ puts "No C files found to check"
100
+ next
101
+ end
102
+
103
+ puts "Found #{files.length} files to check (excluding generated files)"
104
+
105
+ needs_format = false
106
+ files.each do |file|
107
+ formatted = `clang-format -style=file #{file}`
108
+ original = File.read(file)
109
+
110
+ if formatted != original
111
+ puts "❌ #{file} needs formatting"
112
+ puts "Diff:"
113
+ # Save formatted version to temp file and run diff
114
+ temp_file = "#{file}.formatted"
115
+ File.write(temp_file, formatted)
116
+ system("diff -u #{file} #{temp_file}")
117
+ File.unlink(temp_file)
118
+ needs_format = true
119
+ end
120
+ end
121
+
122
+ if needs_format
123
+ warn "Some files need formatting. Run 'rake format:c' to format them."
124
+ exit 1
125
+ else
126
+ puts "✅ All files are properly formatted"
127
+ end
128
+ end
129
+ end
130
+
52
131
  rule ".c" => ".re" do |t|
53
132
  puts "⚠️⚠️⚠️ #{t.name} is older than #{t.source}. You may need to run `rake lexer` ⚠️⚠️⚠️"
54
133
  end
@@ -78,6 +157,9 @@ task :templates do
78
157
 
79
158
  sh "#{ruby} templates/template.rb include/rbs/ast.h"
80
159
  sh "#{ruby} templates/template.rb src/ast.c"
160
+
161
+ # Format the generated files
162
+ Rake::Task["format:c"].invoke
81
163
  end
82
164
 
83
165
  task :compile => "ext/rbs_extension/class_constants.h"
@@ -437,3 +519,11 @@ task :changelog do
437
519
  puts " (🤑 There is no *unreleased* pull request associated to the milestone.)"
438
520
  end
439
521
  end
522
+
523
+ desc "Compile extension without C23 extensions"
524
+ task :compile_c99 do
525
+ ENV["TEST_NO_C23"] = "true"
526
+ Rake::Task[:"compile"].invoke
527
+ ensure
528
+ ENV.delete("TEST_NO_C23")
529
+ end
data/config.yml CHANGED
@@ -345,7 +345,7 @@ nodes:
345
345
  - name: RBS::Types::Bases::Top
346
346
  - name: RBS::Types::Bases::Void
347
347
  - name: RBS::Types::Block
348
- expose_location: false
348
+ expose_location: true
349
349
  fields:
350
350
  - name: type
351
351
  c_type: rbs_node
data/core/enumerable.rbs CHANGED
@@ -192,6 +192,11 @@
192
192
  # find exactly one of each Hash entry.
193
193
  #
194
194
  module Enumerable[unchecked out Elem] : _Each[Elem]
195
+ %a{private}
196
+ interface _Pattern
197
+ def ===: (untyped) -> bool
198
+ end
199
+
195
200
  # <!--
196
201
  # rdoc-file=enum.c
197
202
  # - all? -> true or false
@@ -234,6 +239,7 @@ module Enumerable[unchecked out Elem] : _Each[Elem]
234
239
  # Related: #any?, #none? #one?.
235
240
  #
236
241
  def all?: () -> bool
242
+ | (_Pattern) -> bool
237
243
  | () { (Elem) -> boolish } -> bool
238
244
 
239
245
  # <!--
@@ -277,6 +283,7 @@ module Enumerable[unchecked out Elem] : _Each[Elem]
277
283
  # Related: #all?, #none?, #one?.
278
284
  #
279
285
  def any?: () -> bool
286
+ | (_Pattern) -> bool
280
287
  | () { (Elem) -> boolish } -> bool
281
288
 
282
289
  # <!--
@@ -1167,6 +1174,7 @@ module Enumerable[unchecked out Elem] : _Each[Elem]
1167
1174
  # Related: #one?, #all?, #any?.
1168
1175
  #
1169
1176
  def none?: () -> bool
1177
+ | (_Pattern) -> bool
1170
1178
  | () { (Elem) -> boolish } -> bool
1171
1179
 
1172
1180
  # <!--
@@ -1210,6 +1218,7 @@ module Enumerable[unchecked out Elem] : _Each[Elem]
1210
1218
  # Related: #none?, #all?, #any?.
1211
1219
  #
1212
1220
  def one?: () -> bool
1221
+ | (_Pattern) -> bool
1213
1222
  | () { (Elem) -> boolish } -> bool
1214
1223
 
1215
1224
  # <!--
data/core/io.rbs CHANGED
@@ -2278,7 +2278,7 @@ class IO < Object
2278
2278
  # potential security vulnerabilities if called with untrusted input; see
2279
2279
  # [Command Injection](rdoc-ref:command_injection.rdoc).
2280
2280
  #
2281
- def self.binread: (String name, ?Integer? length, ?Integer offset) -> String
2281
+ def self.binread: (path name, ?Integer? length, ?Integer offset) -> String
2282
2282
 
2283
2283
  # <!--
2284
2284
  # rdoc-file=io.c
@@ -2291,7 +2291,7 @@ class IO < Object
2291
2291
  # potential security vulnerabilities if called with untrusted input; see
2292
2292
  # [Command Injection](rdoc-ref:command_injection.rdoc).
2293
2293
  #
2294
- def self.binwrite: (String name, _ToS string, ?Integer offset, ?mode: String mode) -> Integer
2294
+ def self.binwrite: (path name, _ToS string, ?Integer offset, ?mode: String mode) -> Integer
2295
2295
 
2296
2296
  # <!--
2297
2297
  # rdoc-file=io.c
@@ -2716,7 +2716,7 @@ class IO < Object
2716
2716
  # * [Open Options](rdoc-ref:IO@Open+Options).
2717
2717
  # * [Encoding options](rdoc-ref:encodings.rdoc@Encoding+Options).
2718
2718
  #
2719
- def self.read: (String name, ?Integer? length, ?Integer offset, ?external_encoding: String | Encoding | nil, ?internal_encoding: String | Encoding | nil, ?encoding: String | Encoding | nil, ?textmode: boolish, ?binmode: boolish, ?autoclose: boolish, ?mode: String) -> String
2719
+ def self.read: (path name, ?Integer? length, ?Integer offset, ?external_encoding: String | Encoding | nil, ?internal_encoding: String | Encoding | nil, ?encoding: String | Encoding | nil, ?textmode: boolish, ?binmode: boolish, ?autoclose: boolish, ?mode: String) -> String
2720
2720
 
2721
2721
  # <!--
2722
2722
  # rdoc-file=io.c
@@ -2986,7 +2986,7 @@ class IO < Object
2986
2986
  # * [Open Options](rdoc-ref:IO@Open+Options).
2987
2987
  # * [Encoding options](rdoc-ref:encodings.rdoc@Encoding+Options).
2988
2988
  #
2989
- def self.write: (String path, _ToS data, ?Integer offset, ?external_encoding: String | Encoding | nil, ?internal_encoding: String | Encoding | nil, ?encoding: String | Encoding | nil, ?textmode: boolish, ?binmode: boolish, ?autoclose: boolish, ?mode: String) -> Integer
2989
+ def self.write: (path path, _ToS data, ?Integer offset, ?external_encoding: String | Encoding | nil, ?internal_encoding: String | Encoding | nil, ?encoding: String | Encoding | nil, ?textmode: boolish, ?binmode: boolish, ?autoclose: boolish, ?mode: String) -> Integer
2990
2990
 
2991
2991
  # <!--
2992
2992
  # rdoc-file=io.c
data/core/thread.rbs CHANGED
@@ -829,13 +829,6 @@ class Thread < Object
829
829
  #
830
830
  def self.each_caller_location: () { (Backtrace::Location) -> void } -> nil
831
831
 
832
- # Wraps the block in a single, VM-global
833
- # [Mutex\#synchronize](https://ruby-doc.org/core-2.6.3/Mutex.html#method-i-synchronize)
834
- # , returning the value of the block. A thread executing inside the
835
- # exclusive section will only block other threads which also use the
836
- # [::exclusive](Thread.downloaded.ruby_doc#method-c-exclusive) mechanism.
837
- def self.exclusive: () { () -> untyped } -> untyped
838
-
839
832
  # <!--
840
833
  # rdoc-file=thread.c
841
834
  # - Thread.exit -> thread