apoelstra/bitcoin-secp256k1-rs — pull request #3 by micmarsh (2014-10-26 19:27:35+00:00)
Title: Fix Compilation Error

When I was trying to build https://github.com/apoelstra/rust-bitcoin, I kept getting the following error messages:
```
src/key.rs:85:13: 85:34 error: static variables cannot be referenced in a pattern, use a `const` instead
src/key.rs:85 constants::NONCE_SIZE => {
^~~~~~~~~~~~~~~~~~~~~
src/key.rs:176:13: 176:39 error: static variables cannot be referenced in a pattern, use a `const` instead
src/key.rs:176 constants::SECRET_KEY_SIZE => {
^~~~~~~~~~~~~~~~~~~~~~~~~~
src/key.rs:263:13: 263:50 error: static variables cannot be referenced in a pattern, use a `const` instead
src/key.rs:263 constants::COMPRESSED_PUBLIC_KEY_SIZE => {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
src/key.rs:276:13: 276:52 error: static variables cannot be referenced in a pattern, use a `const` instead
src/key.rs:276 constants::UNCOMPRESSED_PUBLIC_KEY_SIZE => {
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
error: aborting due to 4 previous errors
```
and then (after forking and fixing)
```
src/key.rs:116:27: 116:36 error: expected constant integer for repeat count, found variable
src/key.rs:116 let mut x = [0, ..HMAC_SIZE];
^~~~~~~~~
src/key.rs:121:32: 121:41 error: expected constant integer for repeat count, found variable
src/key.rs:121 let mut V = [0x01u8, ..HMAC_SIZE];
^~~~~~~~~
src/key.rs:123:32: 123:41 error: expected constant integer for repeat count, found variable
src/key.rs:123 let mut K = [0x00u8, ..HMAC_SIZE];
^~~~~~~~~
src/key.rs:141:36: 141:45 error: expected constant integer for repeat count, found variable
src/key.rs:141 let mut T = [0x00u8, ..HMAC_SIZE];
^~~~~~~~~
error: aborting due to 4 previous errors
```

I *seem* to have fixed the problems by changing all referenced statics to consts. As a Rust n00b, I don't know if there was a reason they were static in the first place.

I'm sure there's some compiler release I could track down to pinpoint the breaking change if I were feeling so inclined. Just let me know if you want any more info!