The assert in this crate (which is derived from std::bitv) passes when compiled _without_ -O and fails when compiled _with_ -O: ``` use std; fn some_unused_fn() { fail } trait methods { fn to_bytes() -> ~[u8]; } impl of methods for () { fn to_bytes() -> ~[u8] { vec::from_elem(42, 0) } } // the position of this function is significant! - if it comes before methods // then it works, if it comes after it then it doesnt! fn to_bools(bitv: {storage: ~[u64], nbits: uint}) -> ~[bool] { vec::from_fn(bitv.nbits, |i| { let w = i / 64; let b = i % 64; let x = 1u64 & (bitv.storage[w] >> b); x == 1u64 }) } fn main() { let bools = ~[false, false, true, false, false, true, true, false]; let bitv = {storage: ~[0b01100100], nbits: 8}; assert to_bools(bitv) == bools; } ``` As mentioned in a comment in the code the position of the items in the crate also seem to be significant. Removing `some_unused_fn` and/or `methods` also makes the code work as expected. This bug is blocking #2964 and possibly #2341. I found this bug on a 64 bit Ubuntu system.