Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions src/building/bootstrapping/writing-tools-in-bootstrap.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,16 @@ There are three types of tools you can write in bootstrap:

Use this for tools that use the `rustc_private` mechanism,
and thus depend on the locally built `rustc` and its rlib artifacts.
This is more complex than the other modes because the tool must be built with the same compiler used for `rustc` and placed in the "stageN-tools" directory.
When you choose `Mode::ToolRustcPrivate`, `ToolBuild` implementation takes care of this automatically.
This is more complex than the other modes,
because the tool must be built with the same compiler used for `rustc`,
and placed in the "stageN-tools" directory.
When you choose `Mode::ToolRustcPrivate`,
`ToolBuild` implementation takes care of this automatically.
If you need to use the builder’s compiler for something specific,
you can get it from `ToolBuildResult`, which is returned by the tool's [`Step`].

Regardless of the tool type you must return `ToolBuildResult` from the tool’s [`Step`] implementation and use `ToolBuild` inside it.
Regardless of the tool type,
you must return `ToolBuildResult` from the tool’s [`Step`] implementation,
and use `ToolBuild` inside it.

[`Step`]: https://doc.rust-lang.org/nightly/nightly-rustc/bootstrap/core/builder/trait.Step.html