diff options
| author | Luqman Aden <me@luqman.ca> | 2013-07-28 04:25:33 -0400 |
|---|---|---|
| committer | Luqman Aden <me@luqman.ca> | 2013-07-28 04:52:13 -0400 |
| commit | 7bd6a92a5a73be334f09791bbc3c83468b10410c (patch) | |
| tree | ae40775ed4defe34c2725ed9905f842804572286 | |
| parent | 9325535b41fa5a7cfac697e86ae86bd1384542e6 (diff) | |
| download | rust-7bd6a92a5a73be334f09791bbc3c83468b10410c.tar.gz rust-7bd6a92a5a73be334f09791bbc3c83468b10410c.zip | |
librust: Stop rust tool from crashing on macos.
| -rw-r--r-- | src/librust/rust.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/librust/rust.rs b/src/librust/rust.rs index c47c573d16f..746b7529231 100644 --- a/src/librust/rust.rs +++ b/src/librust/rust.rs @@ -60,7 +60,13 @@ struct Command<'self> { usage_full: UsageSource<'self>, } -static COMMANDS: &'static [Command<'static>] = &[ +static NUM_OF_COMMANDS: uint = 7; + +// FIXME(#7617): should just be &'static [Command<'static>] +// but mac os doesn't seem to like that and tries to loop +// past the end of COMMANDS in usage thus passing garbage +// to str::repeat and eventually malloc and crashing. +static COMMANDS: [Command<'static>, .. NUM_OF_COMMANDS] = [ Command{ cmd: "build", action: CallMain("rustc", rustc::main), |
