about summary refs log tree commit diff
path: root/src/bootstrap
diff options
context:
space:
mode:
authorkennytm <kennytm@gmail.com>2018-02-16 14:27:45 +0800
committerkennytm <kennytm@gmail.com>2018-02-16 14:31:25 +0800
commitc788433b15a81935abcb84e9644d04422bf84a48 (patch)
treec8ed6bb380420088c73b673fe4059f17140301bb /src/bootstrap
parent366a65665aed84fda50e4ea8bc905153ffcc1287 (diff)
downloadrust-c788433b15a81935abcb84e9644d04422bf84a48.tar.gz
rust-c788433b15a81935abcb84e9644d04422bf84a48.zip
Fix panic when `x.py` is called without any arguments.
Diffstat (limited to 'src/bootstrap')
-rw-r--r--src/bootstrap/builder.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/bootstrap/builder.rs b/src/bootstrap/builder.rs
index 7345b284dc7..66a1c972462 100644
--- a/src/bootstrap/builder.rs
+++ b/src/bootstrap/builder.rs
@@ -385,8 +385,10 @@ impl<'a> Builder<'a> {
             Subcommand::Clean { .. } => panic!(),
         };
 
-        if paths[0] == Path::new("nonexistent/path/to/trigger/cargo/metadata") {
-            return;
+        if let Some(path) = paths.get(0) {
+            if path == Path::new("nonexistent/path/to/trigger/cargo/metadata") {
+                return;
+            }
         }
 
         let builder = Builder {