about summary refs log tree commit diff
path: root/src/doc/rustc-dev-guide
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2025-03-19 12:39:34 +0000
committerbors <bors@rust-lang.org>2025-03-19 12:39:34 +0000
commita7fc463dd8fbeca800d4b3efc501069502cffe64 (patch)
tree097c6944fd8660666094e1c1f7adfca493dd37dc /src/doc/rustc-dev-guide
parentc4b38a596767c9c6275c937cf3a2d4b9612b4875 (diff)
parent3b7faca09c7a2e86390e354e83cb1acac6b3a1fd (diff)
downloadrust-a7fc463dd8fbeca800d4b3efc501069502cffe64.tar.gz
rust-a7fc463dd8fbeca800d4b3efc501069502cffe64.zip
Auto merge of #138693 - matthiaskrgr:rollup-ejq8mwp, r=matthiaskrgr
Rollup of 10 pull requests

Successful merges:

 - #136177 (clarify BufRead::{fill_buf, consume} docs)
 - #138654 (Remove the regex dependency from coretests)
 - #138655 (rustc-dev-guide sync)
 - #138656 (Remove double nesting in post-merge workflow)
 - #138658 (CI: mirror alpine and centos images to ghcr)
 - #138659 (coverage: Don't store a body span in `FunctionCoverageInfo`)
 - #138661 (Revert: Add *_value methods to proc_macro lib)
 - #138670 (Remove existing AFIDT implementation)
 - #138674 (Various codegen_llvm cleanups)
 - #138684 (use then in docs for `fuse` to enhance readability)

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'src/doc/rustc-dev-guide')
-rw-r--r--src/doc/rustc-dev-guide/rust-version2
-rw-r--r--src/doc/rustc-dev-guide/src/building/suggested.md26
-rw-r--r--src/doc/rustc-dev-guide/src/contributing.md2
-rw-r--r--src/doc/rustc-dev-guide/src/implementing_new_features.md2
-rw-r--r--src/doc/rustc-dev-guide/src/tests/running.md56
5 files changed, 56 insertions, 32 deletions
diff --git a/src/doc/rustc-dev-guide/rust-version b/src/doc/rustc-dev-guide/rust-version
index eb779d9ab05..6baf43397e8 100644
--- a/src/doc/rustc-dev-guide/rust-version
+++ b/src/doc/rustc-dev-guide/rust-version
@@ -1 +1 @@
-8536f201ffdb2c24925d7f9e87996d7dca93428b
+493c38ba371929579fe136df26eccd9516347c7a
diff --git a/src/doc/rustc-dev-guide/src/building/suggested.md b/src/doc/rustc-dev-guide/src/building/suggested.md
index 506f41b165e..43ff2ba726f 100644
--- a/src/doc/rustc-dev-guide/src/building/suggested.md
+++ b/src/doc/rustc-dev-guide/src/building/suggested.md
@@ -123,6 +123,30 @@ Another way is without a plugin, and creating your own logic in your
 configuration. The following code will work for any checkout of rust-lang/rust (newer than Febuary 2025):
 
 ```lua
+local function expand_config_variables(option)
+    local var_placeholders = {
+        ['${workspaceFolder}'] = function(_)
+            return vim.lsp.buf.list_workspace_folders()[1]
+        end,
+    }
+
+    if type(option) == "table" then
+        local mt = getmetatable(option)
+        local result = {}
+        for k, v in pairs(option) do
+            result[expand_config_variables(k)] = expand_config_variables(v)
+        end
+        return setmetatable(result, mt)
+    end
+    if type(option) ~= "string" then
+        return option
+    end
+    local ret = option
+    for key, fn in pairs(var_placeholders) do
+        ret = ret:gsub(key, fn)
+    end
+    return ret
+end
 lspconfig.rust_analyzer.setup {
     root_dir = function()
         local default = lspconfig.rust_analyzer.config_def.default_config.root_dir()
@@ -142,7 +166,7 @@ lspconfig.rust_analyzer.setup {
             -- load rust-lang/rust settings
             local file = io.open(config)
             local json = vim.json.decode(file:read("*a"))
-            client.config.settings["rust-analyzer"] = json.lsp["rust-analyzer"].initialization_options
+            client.config.settings["rust-analyzer"] = expand_config_variables(json.lsp["rust-analyzer"].initialization_options)
             client.notify("workspace/didChangeConfiguration", { settings = client.config.settings })
         end
         return true
diff --git a/src/doc/rustc-dev-guide/src/contributing.md b/src/doc/rustc-dev-guide/src/contributing.md
index 9817326f07b..09a7f912b98 100644
--- a/src/doc/rustc-dev-guide/src/contributing.md
+++ b/src/doc/rustc-dev-guide/src/contributing.md
@@ -81,7 +81,7 @@ smaller user-facing changes.
 into a PR that ends up not getting merged!** [See this document][mcpinfo] for
 more info on MCPs.
 
-[mcpinfo]: https://forge.rust-lang.org/compiler/mcp.html
+[mcpinfo]: https://forge.rust-lang.org/compiler/proposals-and-stabilization.html#how-do-i-submit-an-mcp
 [zulip]: https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler
 
 ### Performance
diff --git a/src/doc/rustc-dev-guide/src/implementing_new_features.md b/src/doc/rustc-dev-guide/src/implementing_new_features.md
index fda38ef4fc0..d7561bbbad2 100644
--- a/src/doc/rustc-dev-guide/src/implementing_new_features.md
+++ b/src/doc/rustc-dev-guide/src/implementing_new_features.md
@@ -44,7 +44,7 @@ like this; for example, the compiler team recommends
 filing a Major Change Proposal ([MCP][mcp]) as a lightweight way to
 garner support and feedback without requiring full consensus.
 
-[mcp]: https://forge.rust-lang.org/compiler/mcp.html#public-facing-changes-require-rfcbot-fcp
+[mcp]: https://forge.rust-lang.org/compiler/proposals-and-stabilization.html#how-do-i-submit-an-mcp
 
 You don't need to have the implementation fully ready for r+ to propose an FCP,
 but it is generally a good idea to have at least a proof
diff --git a/src/doc/rustc-dev-guide/src/tests/running.md b/src/doc/rustc-dev-guide/src/tests/running.md
index ab97fbf9654..73c38736812 100644
--- a/src/doc/rustc-dev-guide/src/tests/running.md
+++ b/src/doc/rustc-dev-guide/src/tests/running.md
@@ -18,7 +18,7 @@ a subset of test collections, and merge queue CI will exercise all of the test
 collection.
 </div>
 
-```bash
+```text
 ./x test
 ```
 
@@ -45,7 +45,7 @@ tests. For example, a good "smoke test" that can be used after modifying rustc
 to see if things are generally working correctly would be to exercise the `ui`
 test suite ([`tests/ui`]):
 
-```bash
+```text
 ./x test tests/ui
 ```
 
@@ -53,14 +53,14 @@ Of course, the choice of test suites is
 somewhat arbitrary, and may not suit the task you are doing. For example, if you
 are hacking on debuginfo, you may be better off with the debuginfo test suite:
 
-```bash
+```text
 ./x test tests/debuginfo
 ```
 
 If you only need to test a specific subdirectory of tests for any given test
 suite, you can pass that directory as a filter to `./x test`:
 
-```bash
+```text
 ./x test tests/ui/const-generics
 ```
 
@@ -73,7 +73,7 @@ suite, you can pass that directory as a filter to `./x test`:
 
 Likewise, you can test a single file by passing its path:
 
-```bash
+```text
 ./x test tests/ui/const-generics/const-test.rs
 ```
 
@@ -81,19 +81,19 @@ Likewise, you can test a single file by passing its path:
 have to use the `--test-args` argument as described
 [below](#running-an-individual-test).
 
-```bash
+```text
 ./x test src/tools/miri --test-args tests/fail/uninit/padding-enum.rs
 ```
 
 ### Run only the tidy script
 
-```bash
+```text
 ./x test tidy
 ```
 
 ### Run tests on the standard library
 
-```bash
+```text
 ./x test --stage 0 library/std
 ```
 
@@ -102,13 +102,13 @@ crates, you have to specify those explicitly.
 
 ### Run the tidy script and tests on the standard library
 
-```bash
+```text
 ./x test --stage 0 tidy library/std
 ```
 
 ### Run tests on the standard library using a stage 1 compiler
 
-```bash
+```text
 ./x test --stage 1 library/std
 ```
 
@@ -122,7 +122,7 @@ the tests **usually** work fine with stage 1, there are some limitations.
 
 ### Run all tests using a stage 2 compiler
 
-```bash
+```text
 ./x test --stage 2
 ```
 
@@ -134,13 +134,13 @@ You almost never need to do this; CI will run these tests for you.
 
 You may want to run unit tests on a specific file with following:
 
-```bash
+```text
 ./x test compiler/rustc_data_structures/src/thin_vec/tests.rs
 ```
 
 But unfortunately, it's impossible. You should invoke the following instead:
 
-```bash
+```text
 ./x test compiler/rustc_data_structures/ --test-args thin_vec
 ```
 
@@ -151,7 +151,7 @@ often the test they are trying to fix. As mentioned earlier, you may pass the
 full file path to achieve this, or alternatively one may invoke `x` with the
 `--test-args` option:
 
-```bash
+```text
 ./x test tests/ui --test-args issue-1234
 ```
 
@@ -203,7 +203,7 @@ When `--pass $mode` is passed, these tests will be forced to run under the given
 `$mode` unless the directive `//@ ignore-pass` exists in the test file. For
 example, you can run all the tests in `tests/ui` as `check-pass`:
 
-```bash
+```text
 ./x test tests/ui --pass check
 ```
 
@@ -219,7 +219,7 @@ first look for expected output in `foo.polonius.stderr`, falling back to the
 usual `foo.stderr` if not found. The following will run the UI test suite in
 Polonius mode:
 
-```bash
+```text
 ./x test tests/ui --compare-mode=polonius
 ```
 
@@ -232,7 +232,7 @@ just `.rs` files, so after [creating a rustup
 toolchain](../building/how-to-build-and-run.md#creating-a-rustup-toolchain), you
 can do something like:
 
-```bash
+```text
 rustc +stage1 tests/ui/issue-1234.rs
 ```
 
@@ -252,7 +252,7 @@ execution* so be careful where it is used.
 To do this, first build `remote-test-server` for the remote machine, e.g. for
 RISC-V
 
-```sh
+```text
 ./x build src/tools/remote-test-server --target riscv64gc-unknown-linux-gnu
 ```
 
@@ -264,7 +264,7 @@ On the remote machine, run the `remote-test-server` with the `--bind
 0.0.0.0:12345` flag (and optionally `-v` for verbose output). Output should look
 like this:
 
-```sh
+```text
 $ ./remote-test-server -v --bind 0.0.0.0:12345
 starting test server
 listening on 0.0.0.0:12345!
@@ -278,7 +278,7 @@ restrictive IP address when binding.
 You can test if the `remote-test-server` is working by connecting to it and
 sending `ping\n`. It should reply `pong`:
 
-```sh
+```text
 $ nc $REMOTE_IP 12345
 ping
 pong
@@ -288,7 +288,7 @@ To run tests using the remote runner, set the `TEST_DEVICE_ADDR` environment
 variable then use `x` as usual. For example, to run `ui` tests for a RISC-V
 machine with the IP address `1.2.3.4` use
 
-```sh
+```text
 export TEST_DEVICE_ADDR="1.2.3.4:12345"
 ./x test tests/ui --target riscv64gc-unknown-linux-gnu
 ```
@@ -296,7 +296,7 @@ export TEST_DEVICE_ADDR="1.2.3.4:12345"
 If `remote-test-server` was run with the verbose flag, output on the test
 machine may look something like
 
-```
+```text
 [...]
 run "/tmp/work/test1007/a"
 run "/tmp/work/test1008/a"
@@ -362,21 +362,21 @@ codegen-backends = ["llvm", "gcc"]
 
 Then you need to install libgccjit 12. For example with `apt`:
 
-```bash
-$ apt install libgccjit-12-dev
+```text
+apt install libgccjit-12-dev
 ```
 
 Now you can run the following command:
 
-```bash
-$ ./x test compiler/rustc_codegen_gcc/
+```text
+./x test compiler/rustc_codegen_gcc/
 ```
 
 If it cannot find the `.so` library (if you installed it with `apt` for example), you
 need to pass the library file path with `LIBRARY_PATH`:
 
-```bash
-$ LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/12/ ./x test compiler/rustc_codegen_gcc/
+```text
+LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/12/ ./x test compiler/rustc_codegen_gcc/
 ```
 
 If you encounter bugs or problems, don't hesitate to open issues on the