remove the requirement of Builder arg in doc::Std::new function

`crates` field is handled in the `Step::make_run` just like in any other
`Std` implementation, so we don't need to resolve them in `Std::new`.

Signed-off-by: onur-ozkan <work@onurozkan.dev>
This commit is contained in:
onur-ozkan 2024-07-26 08:48:46 +03:00
parent 4c87e84f99
commit d3aed2cdb4
4 changed files with 2 additions and 18 deletions

View File

@ -106,7 +106,6 @@ fn run(self, builder: &Builder<'_>) -> Option<GeneratedTarball> {
builder.ensure(crate::core::build_steps::doc::Std::new(
builder.top_stage,
host,
builder,
DocumentationFormat::Json,
));

View File

@ -564,18 +564,8 @@ pub struct Std {
}
impl Std {
pub(crate) fn new(
stage: u32,
target: TargetSelection,
builder: &Builder<'_>,
format: DocumentationFormat,
) -> Self {
let crates = builder
.in_tree_crates("sysroot", Some(target))
.into_iter()
.map(|krate| krate.name.to_string())
.collect();
Std { stage, target, format, crates }
pub(crate) fn new(stage: u32, target: TargetSelection, format: DocumentationFormat) -> Self {
Std { stage, target, format, crates: vec![] }
}
}

View File

@ -847,7 +847,6 @@ fn run(self, builder: &Builder<'_>) {
builder.ensure(crate::core::build_steps::doc::Std::new(
builder.top_stage,
self.target,
builder,
DocumentationFormat::Html,
));
let _guard = builder.msg(

View File

@ -79,13 +79,9 @@ macro_rules! std {
macro_rules! doc_std {
($host:ident => $target:ident, stage = $stage:literal) => {{
let config = configure("doc", &["A-A"], &["A-A"]);
let build = Build::new(config);
let builder = Builder::new(&build);
doc::Std::new(
$stage,
TargetSelection::from_user(concat!(stringify!($target), "-", stringify!($target))),
&builder,
DocumentationFormat::Html,
)
}};