about summary refs log tree commit diff
path: root/src/libsyntax/parse
diff options
context:
space:
mode:
authorJosh Stone <cuviper@gmail.com>2014-12-09 22:06:52 -0800
committerAlexis Beingessner <a.beingessner@gmail.com>2014-12-20 09:10:04 -0500
commit3deb97f5d02ddbdbf20a587815fe84934cda948c (patch)
treeb74e83efd28a5a494e7d272aaddef319fd9e79dc /src/libsyntax/parse
parent8f194de95d00fe540d848cc9a7d3e049ce3684ab (diff)
downloadrust-3deb97f5d02ddbdbf20a587815fe84934cda948c.tar.gz
rust-3deb97f5d02ddbdbf20a587815fe84934cda948c.zip
bitv: Fix all() for nbits that are multiples of u32::BITS
The old logic would be ok with *either* 0 or all 1s in the last word,
because it didn't compute a proper mask for the case where nbits is an
exact multiple of u32::BITS.

Add mask_for_bits() to compute this properly, and use it in all().  Add
all/none assertions to most of the tests.  Note in particular, the all-zero
bitv in test_32_elements() was incorrectly all()==true before this patch.
Diffstat (limited to 'src/libsyntax/parse')
0 files changed, 0 insertions, 0 deletions