docs: Formatting and cross-linking to build-dir/target-dir docs (#15840)

Documentation follow up on
https://github.com/rust-lang/cargo/pull/15833#discussion_r2278150419

r? @weihanglo
This commit is contained in:
Weihang Lo 2025-08-15 12:18:04 +00:00 committed by GitHub
commit c204194c52
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 10 additions and 9 deletions

View File

@ -188,12 +188,12 @@ The meaning of the term *target* depends on the context:
[list of targets][targets] are configured in the `Cargo.toml`
[*manifest*](#manifest), often inferred automatically by the [directory
layout] of the source files.
- **Target Directory** --- Cargo places all built artifacts and intermediate
files in the *target* directory. By default this is a directory named
`target` at the [*workspace*](#workspace) root, or the package root if not
using a workspace. The directory may be changed with the `--target-dir`
command-line option, the `CARGO_TARGET_DIR` [environment variable], or the
`build.target-dir` [config option].
- **Target Directory** --- Cargo places built artifacts in the *target* directory.
By default this is a directory named `target` at the [*workspace*](#workspace) root,
or the package root if not using a workspace. The directory may be changed with
the `--target-dir` command-line option, the `CARGO_TARGET_DIR` [environment variable],
or the `build.target-dir` [config option].
For more information see the [build cache] documentation.
- **Target Architecture** --- The OS and machine architecture for the built
artifacts are typically referred to as a *target*.
- **Target Triple** --- A triple is a specific format for specifying a target
@ -251,6 +251,7 @@ manifest is located. (Compare with [*package root*](#package).)
[Directory Sources]: ../reference/source-replacement.md#directory-sources
[Local Registry Sources]: ../reference/source-replacement.md#local-registry-sources
[Source Replacement]: ../reference/source-replacement.md
[build cache]: ../reference/build-cache.html
[cargo-unstable]: ../reference/unstable.md
[config option]: ../reference/config.md
[crates.io]: https://crates.io/

View File

@ -70,9 +70,9 @@ change. Some of these directories are:
Directory | Description
----------|------------
<code style="white-space: nowrap">build-dir/debug/deps/</code> | Dependencies and other artifacts.
<code style="white-space: nowrap">build-dir/debug/incremental/</code> | `rustc` [incremental output], a cache used to speed up subsequent builds.
<code style="white-space: nowrap">build-dir/debug/build/</code> | Output from [build scripts].
<code style="white-space: nowrap">\<build-dir>/debug/deps/</code> | Dependencies and other artifacts.
<code style="white-space: nowrap">\<build-dir>/debug/incremental/</code> | `rustc` [incremental output], a cache used to speed up subsequent builds.
<code style="white-space: nowrap">\<build-dir>/debug/build/</code> | Output from [build scripts].
## Dep-info files