Skip to content

Commit 44cc009

Browse files
committed
add doc-comments on compile::Rustc
Signed-off-by: onur-ozkan <[email protected]>
1 parent 28d8ac0 commit 44cc009

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/bootstrap/src/core/build_steps/compile.rs

+9
Original file line numberDiff line numberDiff line change
@@ -837,6 +837,13 @@ fn cp_rustc_component_to_ci_sysroot(builder: &Builder<'_>, sysroot: &Path, conte
837837
}
838838
}
839839

840+
/// Low-level implementation of the compiler's compilation process.
841+
///
842+
/// DO NOT `pub` the fields of this type and AVOID using it anywhere
843+
/// unless it’s in the `Assemble` step.
844+
///
845+
/// If you want to build a compiler for a specific stage and target, use
846+
/// `Builder::compiler` instead.
840847
#[derive(Debug, PartialOrd, Ord, Clone, PartialEq, Eq, Hash)]
841848
pub struct Rustc {
842849
target: TargetSelection,
@@ -851,6 +858,8 @@ pub struct Rustc {
851858
}
852859

853860
impl Rustc {
861+
/// Serves as a helpful util for unit tests and should NEVER exist
862+
/// for non-test environment.
854863
#[cfg(test)]
855864
pub fn new(compiler: Compiler, target: TargetSelection) -> Self {
856865
Self { target, compiler, crates: Default::default() }

0 commit comments

Comments
 (0)