]> git.lizzy.rs Git - rust.git/blobdiff - src/bootstrap/doc.rs
Deal with spaces in the rust version.
[rust.git] / src / bootstrap / doc.rs
index f8a549afc88fb81da408d64ca8c9f7519fee8bf8..a1b5ca2ea2fa1f18c128645704f1dd329c0e6d79 100644 (file)
@@ -82,7 +82,7 @@ fn open(builder: &Builder<'_>, path: impl AsRef<Path>) {
     }
 }
 
-// "src/libstd" -> ["src", "libstd"]
+// "library/std" -> ["library", "std"]
 //
 // Used for deciding whether a particular step is one requested by the user on
 // the `x.py doc` command line, which determines whether `--open` will open that
@@ -375,7 +375,7 @@ fn run(self, builder: &Builder<'_>) {
         }
 
         // We open doc/index.html as the default if invoked as `x.py doc --open`
-        // with no particular explicit doc requested (e.g. src/libcore).
+        // with no particular explicit doc requested (e.g. library/core).
         if builder.paths.is_empty() || is_explicit_request(builder, "src/doc") {
             let index = out.join("index.html");
             open(builder, &index);
@@ -456,13 +456,11 @@ fn run(self, builder: &Builder<'_>) {
         }
         builder.cp_r(&out_dir, &out);
 
-        // Look for src/libstd, src/libcore etc in the `x.py doc` arguments and
+        // Look for library/std, library/core etc in the `x.py doc` arguments and
         // open the corresponding rendered docs.
         for path in builder.paths.iter().map(components_simplified) {
-            if path.get(0) == Some(&"src")
-                && path.get(1).map_or(false, |dir| dir.starts_with("lib"))
-            {
-                let requested_crate = &path[1][3..];
+            if path.get(0) == Some(&"library") {
+                let requested_crate = &path[1];
                 if krates.contains(&requested_crate) {
                     let index = out.join(requested_crate).join("index.html");
                     open(builder, &index);
@@ -695,6 +693,7 @@ fn run(self, builder: &Builder<'_>) {
         builder.create_dir(&out);
         builder.remove_dir(&out);
         let mut cmd = builder.tool_cmd(Tool::UnstableBookGen);
+        cmd.arg(builder.src.join("library"));
         cmd.arg(builder.src.join("src"));
         cmd.arg(out);