about summary refs log tree commit diff
path: root/compiler/rustc_codegen_llvm/src/errors.rs
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2025-01-04 18:26:14 +0000
committerbors <bors@rust-lang.org>2025-01-04 18:26:14 +0000
commitead4a8f53624f3b4a9ee833421fbf8a48bc07aca (patch)
tree5d9d8d2bd6b0d5db81e1903bbf0580e0121aca65 /compiler/rustc_codegen_llvm/src/errors.rs
parent2a8af4f7c8262a90b886bc063fe0c271d2b51a45 (diff)
parent4406f42a1851108d745d281449bdd7bbaae35da9 (diff)
downloadrust-ead4a8f53624f3b4a9ee833421fbf8a48bc07aca.tar.gz
rust-ead4a8f53624f3b4a9ee833421fbf8a48bc07aca.zip
Auto merge of #135096 - jieyouxu:fix-doc-submodule-handling, r=onur-ozkan
bootstrap: correctly handle doc paths within submodules

Fixes #135041 by passing the correct submodule path when requiring submodules. This PR changes `is_path_in_submodule` to `submodule_path_of`. `submodule_path_of` returns the path of the containing submodule when given a path nested inside a submodule we handle, and `None` otherwise.

I tested this manually locally by unregistering the `src/tools/cargo` submodule, then running `./x doc src/tools/cargo/src/doc`. This command fails on master with

```
thread 'main' panicked at src/bootstrap/src/utils/helpers.rs:441:5:
std::fs::read_dir(dir) failed with No such file or directory (os error 2)
```

since the require submodule fails as `src/tools/cargo/src/doc` is not a known submodule. Now we use the submodule path if such a nested-in-submodule-path is passed, and thus running this command with cargo submodule unregistered still succeeds:

```
Rustbook (x86_64-unknown-linux-gnu) - cargo
Doc path: /home/joe/repos/rust/build/x86_64-unknown-linux-gnu/doc/cargo/index.html
Build completed successfully in 0:00:11
```

r? `@onur-ozkan`
Diffstat (limited to 'compiler/rustc_codegen_llvm/src/errors.rs')
0 files changed, 0 insertions, 0 deletions