Skip to content

Commit d4e728d

Browse files
committed
add doc-comments on compile::Rustc
Signed-off-by: onur-ozkan <[email protected]>
1 parent 92c12b3 commit d4e728d

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

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

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -946,6 +946,13 @@ fn cp_rustc_component_to_ci_sysroot(builder: &Builder<'_>, sysroot: &Path, conte
946946
}
947947
}
948948

949+
/// Low-level implementation of the compiler's compilation process.
950+
///
951+
/// DO NOT `pub` the fields of this type and AVOID using it anywhere
952+
/// unless it’s in the `Assemble` step.
953+
///
954+
/// If you want to build a compiler for a specific stage and target, use
955+
/// `Builder::compiler` instead.
949956
#[derive(Debug, PartialOrd, Ord, Clone, PartialEq, Eq, Hash)]
950957
pub struct Rustc {
951958
target: TargetSelection,
@@ -960,6 +967,8 @@ pub struct Rustc {
960967
}
961968

962969
impl Rustc {
970+
/// Serves as a helpful util for unit tests and should NEVER exist
971+
/// for non-test environment.
963972
#[cfg(test)]
964973
pub fn new(compiler: Compiler, target: TargetSelection) -> Self {
965974
Self { target, compiler, crates: Default::default() }

0 commit comments

Comments
 (0)