Skip to content

Commit 7bd6a92

Browse files
committed
librust: Stop rust tool from crashing on macos.
1 parent 9325535 commit 7bd6a92

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/librust/rust.rs

+7-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,13 @@ struct Command<'self> {
6060
usage_full: UsageSource<'self>,
6161
}
6262

63-
static COMMANDS: &'static [Command<'static>] = &[
63+
static NUM_OF_COMMANDS: uint = 7;
64+
65+
// FIXME(#7617): should just be &'static [Command<'static>]
66+
// but mac os doesn't seem to like that and tries to loop
67+
// past the end of COMMANDS in usage thus passing garbage
68+
// to str::repeat and eventually malloc and crashing.
69+
static COMMANDS: [Command<'static>, .. NUM_OF_COMMANDS] = [
6470
Command{
6571
cmd: "build",
6672
action: CallMain("rustc", rustc::main),

0 commit comments

Comments
 (0)