rust/src/libnative
Aaron Turon 912a9675c0 Make from_bits in bitflags! safe; add from_bits_truncate
Previously, the `from_bits` function in the `std::bitflags::bitflags`
macro was marked as unsafe, as it did not check that the bits being
converted actually corresponded to flags.

This patch changes the function to check against the full set of
possible flags and return an `Option` which is `None` if a non-flag bit
is set. It also adds a `from_bits_truncate` function which simply zeros
any bits not corresponding to a flag.

This addresses the concern raised in https://github.com/mozilla/rust/pull/13897
2014-05-15 13:50:33 -07:00
..
io Make from_bits in bitflags! safe; add from_bits_truncate 2014-05-15 13:50:33 -07:00
lib.rs io: Implement process wait timeouts 2014-05-13 17:27:42 -07:00
task.rs core: Remove the cast module 2014-05-11 01:13:02 -07:00