Skip to content

Commit 50d1ee9

Browse files
committed
Fix x doc compiler/rustc
This works by mapping the local path to a crate name before trying to fetch crates it depends on.
1 parent 400f23e commit 50d1ee9

File tree

1 file changed

+9
-12
lines changed

1 file changed

+9
-12
lines changed

src/bootstrap/doc.rs

+9-12
Original file line numberDiff line numberDiff line change
@@ -554,13 +554,9 @@ impl Step for Rustc {
554554
let paths = builder
555555
.paths
556556
.iter()
557-
.map(components_simplified)
558-
.filter_map(|path| {
559-
if path.get(0) == Some(&"compiler") {
560-
path.get(1).map(|p| p.to_owned())
561-
} else {
562-
None
563-
}
557+
.filter(|path| {
558+
let components = components_simplified(path);
559+
components.len() >= 2 && components[0] == "compiler"
564560
})
565561
.collect::<Vec<_>>();
566562

@@ -621,16 +617,17 @@ impl Step for Rustc {
621617
);
622618
}
623619
} else {
624-
for root_crate in paths {
625-
if !builder.src.join("compiler").join(&root_crate).exists() {
620+
for root_crate_path in paths {
621+
if !root_crate_path.exists() {
626622
builder.info(&format!(
627-
"\tskipping - compiler/{} (unknown compiler crate)",
628-
root_crate
623+
"\tskipping - {} (unknown compiler crate)",
624+
root_crate_path.display()
629625
));
630626
} else {
627+
let root_crate = builder.crate_paths[root_crate_path];
631628
compiler_crates.extend(
632629
builder
633-
.in_tree_crates(root_crate, Some(target))
630+
.in_tree_crates(&root_crate, Some(target))
634631
.into_iter()
635632
.map(|krate| krate.name),
636633
);

0 commit comments

Comments
 (0)