]> git.lizzy.rs Git - rust.git/commitdiff
Use the existing path when removing the prefix fails. This allows the use of out...
authorPaul Faria <Nashenas88@gmail.com>
Sat, 8 Apr 2017 22:53:57 +0000 (18:53 -0400)
committerPaul Faria <Nashenas88@gmail.com>
Sat, 8 Apr 2017 22:53:57 +0000 (18:53 -0400)
src/bootstrap/step.rs

index 5560b5b0333c862b3c7b64bb23c00e7fcfb5f6c5..74c9ae983737327c66a14f3786c4e9cc28ba926c 100644 (file)
@@ -137,7 +137,9 @@ pub fn build_rules<'a>(build: &'a Build) -> Rules {
         while let Some(krate) = list.pop() {
             let default = krate == name;
             let krate = &build.crates[krate];
-            let path = krate.path.strip_prefix(&build.src).unwrap();
+            let path = krate.path.strip_prefix(&build.src)
+                // This handles out of tree paths
+                .unwrap_or(&krate.path);
             ret.push((krate, path.to_str().unwrap(), default));
             for dep in krate.deps.iter() {
                 if visited.insert(dep) && dep != "build_helper" {