Skip to content

Commit d44a24b

Browse files
authored
Unrolled build for rust-lang#138655
Rollup merge of rust-lang#138655 - Kobzol:rdg-sync, r=jieyouxu rustc-dev-guide sync r? `@jieyouxu`
2 parents c4b38a5 + e9d50f4 commit d44a24b

File tree

5 files changed

+56
-32
lines changed

5 files changed

+56
-32
lines changed

src/doc/rustc-dev-guide/rust-version

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
8536f201ffdb2c24925d7f9e87996d7dca93428b
1+
493c38ba371929579fe136df26eccd9516347c7a

src/doc/rustc-dev-guide/src/building/suggested.md

+25-1
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,30 @@ Another way is without a plugin, and creating your own logic in your
123123
configuration. The following code will work for any checkout of rust-lang/rust (newer than Febuary 2025):
124124

125125
```lua
126+
local function expand_config_variables(option)
127+
local var_placeholders = {
128+
['${workspaceFolder}'] = function(_)
129+
return vim.lsp.buf.list_workspace_folders()[1]
130+
end,
131+
}
132+
133+
if type(option) == "table" then
134+
local mt = getmetatable(option)
135+
local result = {}
136+
for k, v in pairs(option) do
137+
result[expand_config_variables(k)] = expand_config_variables(v)
138+
end
139+
return setmetatable(result, mt)
140+
end
141+
if type(option) ~= "string" then
142+
return option
143+
end
144+
local ret = option
145+
for key, fn in pairs(var_placeholders) do
146+
ret = ret:gsub(key, fn)
147+
end
148+
return ret
149+
end
126150
lspconfig.rust_analyzer.setup {
127151
root_dir = function()
128152
local default = lspconfig.rust_analyzer.config_def.default_config.root_dir()
@@ -142,7 +166,7 @@ lspconfig.rust_analyzer.setup {
142166
-- load rust-lang/rust settings
143167
local file = io.open(config)
144168
local json = vim.json.decode(file:read("*a"))
145-
client.config.settings["rust-analyzer"] = json.lsp["rust-analyzer"].initialization_options
169+
client.config.settings["rust-analyzer"] = expand_config_variables(json.lsp["rust-analyzer"].initialization_options)
146170
client.notify("workspace/didChangeConfiguration", { settings = client.config.settings })
147171
end
148172
return true

src/doc/rustc-dev-guide/src/contributing.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ smaller user-facing changes.
8181
into a PR that ends up not getting merged!** [See this document][mcpinfo] for
8282
more info on MCPs.
8383

84-
[mcpinfo]: https://forge.rust-lang.org/compiler/mcp.html
84+
[mcpinfo]: https://forge.rust-lang.org/compiler/proposals-and-stabilization.html#how-do-i-submit-an-mcp
8585
[zulip]: https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler
8686

8787
### Performance

src/doc/rustc-dev-guide/src/implementing_new_features.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ like this; for example, the compiler team recommends
4444
filing a Major Change Proposal ([MCP][mcp]) as a lightweight way to
4545
garner support and feedback without requiring full consensus.
4646

47-
[mcp]: https://forge.rust-lang.org/compiler/mcp.html#public-facing-changes-require-rfcbot-fcp
47+
[mcp]: https://forge.rust-lang.org/compiler/proposals-and-stabilization.html#how-do-i-submit-an-mcp
4848

4949
You don't need to have the implementation fully ready for r+ to propose an FCP,
5050
but it is generally a good idea to have at least a proof

src/doc/rustc-dev-guide/src/tests/running.md

+28-28
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ a subset of test collections, and merge queue CI will exercise all of the test
1818
collection.
1919
</div>
2020

21-
```bash
21+
```text
2222
./x test
2323
```
2424

@@ -45,22 +45,22 @@ tests. For example, a good "smoke test" that can be used after modifying rustc
4545
to see if things are generally working correctly would be to exercise the `ui`
4646
test suite ([`tests/ui`]):
4747

48-
```bash
48+
```text
4949
./x test tests/ui
5050
```
5151

5252
Of course, the choice of test suites is
5353
somewhat arbitrary, and may not suit the task you are doing. For example, if you
5454
are hacking on debuginfo, you may be better off with the debuginfo test suite:
5555

56-
```bash
56+
```text
5757
./x test tests/debuginfo
5858
```
5959

6060
If you only need to test a specific subdirectory of tests for any given test
6161
suite, you can pass that directory as a filter to `./x test`:
6262

63-
```bash
63+
```text
6464
./x test tests/ui/const-generics
6565
```
6666

@@ -73,27 +73,27 @@ suite, you can pass that directory as a filter to `./x test`:
7373
7474
Likewise, you can test a single file by passing its path:
7575

76-
```bash
76+
```text
7777
./x test tests/ui/const-generics/const-test.rs
7878
```
7979

8080
`x` doesn't support running a single tool test by passing its path yet. You'll
8181
have to use the `--test-args` argument as described
8282
[below](#running-an-individual-test).
8383

84-
```bash
84+
```text
8585
./x test src/tools/miri --test-args tests/fail/uninit/padding-enum.rs
8686
```
8787

8888
### Run only the tidy script
8989

90-
```bash
90+
```text
9191
./x test tidy
9292
```
9393

9494
### Run tests on the standard library
9595

96-
```bash
96+
```text
9797
./x test --stage 0 library/std
9898
```
9999

@@ -102,13 +102,13 @@ crates, you have to specify those explicitly.
102102

103103
### Run the tidy script and tests on the standard library
104104

105-
```bash
105+
```text
106106
./x test --stage 0 tidy library/std
107107
```
108108

109109
### Run tests on the standard library using a stage 1 compiler
110110

111-
```bash
111+
```text
112112
./x test --stage 1 library/std
113113
```
114114

@@ -122,7 +122,7 @@ the tests **usually** work fine with stage 1, there are some limitations.
122122

123123
### Run all tests using a stage 2 compiler
124124

125-
```bash
125+
```text
126126
./x test --stage 2
127127
```
128128

@@ -134,13 +134,13 @@ You almost never need to do this; CI will run these tests for you.
134134

135135
You may want to run unit tests on a specific file with following:
136136

137-
```bash
137+
```text
138138
./x test compiler/rustc_data_structures/src/thin_vec/tests.rs
139139
```
140140

141141
But unfortunately, it's impossible. You should invoke the following instead:
142142

143-
```bash
143+
```text
144144
./x test compiler/rustc_data_structures/ --test-args thin_vec
145145
```
146146

@@ -151,7 +151,7 @@ often the test they are trying to fix. As mentioned earlier, you may pass the
151151
full file path to achieve this, or alternatively one may invoke `x` with the
152152
`--test-args` option:
153153

154-
```bash
154+
```text
155155
./x test tests/ui --test-args issue-1234
156156
```
157157

@@ -203,7 +203,7 @@ When `--pass $mode` is passed, these tests will be forced to run under the given
203203
`$mode` unless the directive `//@ ignore-pass` exists in the test file. For
204204
example, you can run all the tests in `tests/ui` as `check-pass`:
205205

206-
```bash
206+
```text
207207
./x test tests/ui --pass check
208208
```
209209

@@ -219,7 +219,7 @@ first look for expected output in `foo.polonius.stderr`, falling back to the
219219
usual `foo.stderr` if not found. The following will run the UI test suite in
220220
Polonius mode:
221221

222-
```bash
222+
```text
223223
./x test tests/ui --compare-mode=polonius
224224
```
225225

@@ -232,7 +232,7 @@ just `.rs` files, so after [creating a rustup
232232
toolchain](../building/how-to-build-and-run.md#creating-a-rustup-toolchain), you
233233
can do something like:
234234

235-
```bash
235+
```text
236236
rustc +stage1 tests/ui/issue-1234.rs
237237
```
238238

@@ -252,7 +252,7 @@ execution* so be careful where it is used.
252252
To do this, first build `remote-test-server` for the remote machine, e.g. for
253253
RISC-V
254254

255-
```sh
255+
```text
256256
./x build src/tools/remote-test-server --target riscv64gc-unknown-linux-gnu
257257
```
258258

@@ -264,7 +264,7 @@ On the remote machine, run the `remote-test-server` with the `--bind
264264
0.0.0.0:12345` flag (and optionally `-v` for verbose output). Output should look
265265
like this:
266266

267-
```sh
267+
```text
268268
$ ./remote-test-server -v --bind 0.0.0.0:12345
269269
starting test server
270270
listening on 0.0.0.0:12345!
@@ -278,7 +278,7 @@ restrictive IP address when binding.
278278
You can test if the `remote-test-server` is working by connecting to it and
279279
sending `ping\n`. It should reply `pong`:
280280

281-
```sh
281+
```text
282282
$ nc $REMOTE_IP 12345
283283
ping
284284
pong
@@ -288,15 +288,15 @@ To run tests using the remote runner, set the `TEST_DEVICE_ADDR` environment
288288
variable then use `x` as usual. For example, to run `ui` tests for a RISC-V
289289
machine with the IP address `1.2.3.4` use
290290

291-
```sh
291+
```text
292292
export TEST_DEVICE_ADDR="1.2.3.4:12345"
293293
./x test tests/ui --target riscv64gc-unknown-linux-gnu
294294
```
295295

296296
If `remote-test-server` was run with the verbose flag, output on the test
297297
machine may look something like
298298

299-
```
299+
```text
300300
[...]
301301
run "/tmp/work/test1007/a"
302302
run "/tmp/work/test1008/a"
@@ -362,21 +362,21 @@ codegen-backends = ["llvm", "gcc"]
362362

363363
Then you need to install libgccjit 12. For example with `apt`:
364364

365-
```bash
366-
$ apt install libgccjit-12-dev
365+
```text
366+
apt install libgccjit-12-dev
367367
```
368368

369369
Now you can run the following command:
370370

371-
```bash
372-
$ ./x test compiler/rustc_codegen_gcc/
371+
```text
372+
./x test compiler/rustc_codegen_gcc/
373373
```
374374

375375
If it cannot find the `.so` library (if you installed it with `apt` for example), you
376376
need to pass the library file path with `LIBRARY_PATH`:
377377

378-
```bash
379-
$ LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/12/ ./x test compiler/rustc_codegen_gcc/
378+
```text
379+
LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/12/ ./x test compiler/rustc_codegen_gcc/
380380
```
381381

382382
If you encounter bugs or problems, don't hesitate to open issues on the

0 commit comments

Comments
 (0)