You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is related to this issue in the implementation of iterators in this PR #204 (comment) Using from_bits instead of from_bits_unchecked should allow to produce any valid flags that are not a combination of other flags but at the moment from_bits seems to accept any flag that is included in a combination even if it's not declared. I can try to send a PR.
The text was updated successfully, but these errors were encountered:
arturoc
added a commit
to arturoc/bitflags
that referenced
this issue
Apr 19, 2022
When a bitflags type contains composite flags like:
```rs
bitflags! {
struct Flags: u8 {
const A = 0b00000001;
const BC = 0b00000110;
}
}
```
from_bits and from_bits_truncate would not work as expected allowing flags that are not declared.
Fixesbitflags#275
Unless I'm missing something this test should pass but it fails cause from_bits accepts flags that are not declared.
https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=6fd4adbddc8b8740cbd35af2306073ca
This is related to this issue in the implementation of iterators in this PR #204 (comment) Using
from_bits
instead offrom_bits_unchecked
should allow to produce any valid flags that are not a combination of other flags but at the momentfrom_bits
seems to accept any flag that is included in a combination even if it's not declared. I can try to send a PR.The text was updated successfully, but these errors were encountered: