| 1 |
# 2.9.0 |
| 2 |
|
| 3 |
## What's Changed |
| 4 |
* `Flags` trait: add `clear(&mut self)` method by @wysiwys in https://github.com/bitflags/bitflags/pull/437 |
| 5 |
* Fix up UI tests by @KodrAus in https://github.com/bitflags/bitflags/pull/438 |
| 6 |
|
| 7 |
|
| 8 |
**Full Changelog**: https://github.com/bitflags/bitflags/compare/2.8.0...2.9.0 |
| 9 |
|
| 10 |
# 2.8.0 |
| 11 |
|
| 12 |
## What's Changed |
| 13 |
* feat(core): Add bitflags_match macro for bitflag matching by @YuniqueUnic in https://github.com/bitflags/bitflags/pull/423 |
| 14 |
* Finalize bitflags_match by @KodrAus in https://github.com/bitflags/bitflags/pull/431 |
| 15 |
|
| 16 |
## New Contributors |
| 17 |
* @YuniqueUnic made their first contribution in https://github.com/bitflags/bitflags/pull/423 |
| 18 |
|
| 19 |
**Full Changelog**: https://github.com/bitflags/bitflags/compare/2.7.0...2.8.0 |
| 20 |
|
| 21 |
# 2.7.0 |
| 22 |
|
| 23 |
## What's Changed |
| 24 |
* Fix `clippy::doc_lazy_continuation` lints by @waywardmonkeys in https://github.com/bitflags/bitflags/pull/414 |
| 25 |
* Run clippy on extra features in CI. by @waywardmonkeys in https://github.com/bitflags/bitflags/pull/415 |
| 26 |
* Fix CI: trybuild refresh, allow some clippy restrictions. by @waywardmonkeys in https://github.com/bitflags/bitflags/pull/417 |
| 27 |
* Update zerocopy version in example by @KodrAus in https://github.com/bitflags/bitflags/pull/422 |
| 28 |
* Add method to check if unknown bits are set by @wysiwys in https://github.com/bitflags/bitflags/pull/426 |
| 29 |
* Update error messages by @KodrAus in https://github.com/bitflags/bitflags/pull/427 |
| 30 |
* Add `truncate(&mut self)` method to unset unknown bits by @wysiwys in https://github.com/bitflags/bitflags/pull/428 |
| 31 |
* Update error messages by @KodrAus in https://github.com/bitflags/bitflags/pull/429 |
| 32 |
|
| 33 |
## New Contributors |
| 34 |
* @wysiwys made their first contribution in https://github.com/bitflags/bitflags/pull/426 |
| 35 |
|
| 36 |
**Full Changelog**: https://github.com/bitflags/bitflags/compare/2.6.0...2.7.0 |
| 37 |
|
| 38 |
# 2.6.0 |
| 39 |
|
| 40 |
## What's Changed |
| 41 |
* Sync CHANGELOG.md with github release notes by @dextero in https://github.com/bitflags/bitflags/pull/402 |
| 42 |
* Update error messages and zerocopy by @KodrAus in https://github.com/bitflags/bitflags/pull/403 |
| 43 |
* Bump minimum declared versions of dependencies by @dextero in https://github.com/bitflags/bitflags/pull/404 |
| 44 |
* chore(deps): bump serde_derive and bytemuck versions by @joshka in https://github.com/bitflags/bitflags/pull/405 |
| 45 |
* add OSFF Scorecard workflow by @KodrAus in https://github.com/bitflags/bitflags/pull/396 |
| 46 |
* Update stderr messages by @KodrAus in https://github.com/bitflags/bitflags/pull/408 |
| 47 |
* Fix typo by @waywardmonkeys in https://github.com/bitflags/bitflags/pull/410 |
| 48 |
* Allow specifying outer attributes in impl mode by @KodrAus in https://github.com/bitflags/bitflags/pull/411 |
| 49 |
|
| 50 |
## New Contributors |
| 51 |
* @dextero made their first contribution in https://github.com/bitflags/bitflags/pull/402 |
| 52 |
* @joshka made their first contribution in https://github.com/bitflags/bitflags/pull/405 |
| 53 |
* @waywardmonkeys made their first contribution in https://github.com/bitflags/bitflags/pull/410 |
| 54 |
|
| 55 |
**Full Changelog**: https://github.com/bitflags/bitflags/compare/2.5.0...2.6.0 |
| 56 |
|
| 57 |
# 2.5.0 |
| 58 |
|
| 59 |
## What's Changed |
| 60 |
* Derive `Debug` for `Flag<B>` by @tgross35 in https://github.com/bitflags/bitflags/pull/398 |
| 61 |
* Support truncating or strict-named variants of parsing and formatting by @KodrAus in https://github.com/bitflags/bitflags/pull/400 |
| 62 |
|
| 63 |
## New Contributors |
| 64 |
* @tgross35 made their first contribution in https://github.com/bitflags/bitflags/pull/398 |
| 65 |
|
| 66 |
**Full Changelog**: https://github.com/bitflags/bitflags/compare/2.4.2...2.5.0 |
| 67 |
|
| 68 |
# 2.4.2 |
| 69 |
|
| 70 |
## What's Changed |
| 71 |
* Cargo.toml: Anchor excludes to root of the package by @jamessan in https://github.com/bitflags/bitflags/pull/387 |
| 72 |
* Update error messages by @KodrAus in https://github.com/bitflags/bitflags/pull/390 |
| 73 |
* Add support for impl mode structs to be repr(packed) by @GnomedDev in https://github.com/bitflags/bitflags/pull/388 |
| 74 |
* Remove old `unused_tuple_struct_fields` lint by @dtolnay in https://github.com/bitflags/bitflags/pull/393 |
| 75 |
* Delete use of `local_inner_macros` by @dtolnay in https://github.com/bitflags/bitflags/pull/392 |
| 76 |
|
| 77 |
## New Contributors |
| 78 |
* @jamessan made their first contribution in https://github.com/bitflags/bitflags/pull/387 |
| 79 |
* @GnomedDev made their first contribution in https://github.com/bitflags/bitflags/pull/388 |
| 80 |
|
| 81 |
**Full Changelog**: https://github.com/bitflags/bitflags/compare/2.4.1...2.4.2 |
| 82 |
|
| 83 |
# 2.4.1 |
| 84 |
|
| 85 |
## What's Changed |
| 86 |
* Allow some new pedantic clippy lints by @KodrAus in https://github.com/bitflags/bitflags/pull/380 |
| 87 |
|
| 88 |
**Full Changelog**: https://github.com/bitflags/bitflags/compare/2.4.0...2.4.1 |
| 89 |
|
| 90 |
# 2.4.0 |
| 91 |
|
| 92 |
## What's Changed |
| 93 |
* Remove html_root_url by @eldruin in https://github.com/bitflags/bitflags/pull/368 |
| 94 |
* Support unnamed flags by @KodrAus in https://github.com/bitflags/bitflags/pull/371 |
| 95 |
* Update smoke test to verify all Clippy and rustc lints by @MitMaro in https://github.com/bitflags/bitflags/pull/374 |
| 96 |
* Specify the behavior of bitflags by @KodrAus in https://github.com/bitflags/bitflags/pull/369 |
| 97 |
|
| 98 |
## New Contributors |
| 99 |
* @eldruin made their first contribution in https://github.com/bitflags/bitflags/pull/368 |
| 100 |
* @MitMaro made their first contribution in https://github.com/bitflags/bitflags/pull/374 |
| 101 |
|
| 102 |
**Full Changelog**: https://github.com/bitflags/bitflags/compare/2.3.3...2.4.0 |
| 103 |
|
| 104 |
# 2.3.3 |
| 105 |
|
| 106 |
## Changes to `-=` |
| 107 |
|
| 108 |
The `-=` operator was incorrectly changed to truncate bits that didn't correspond to valid flags in `2.3.0`. This has |
| 109 |
been fixed up so it once again behaves the same as `-` and `difference`. |
| 110 |
|
| 111 |
## Changes to `!` |
| 112 |
|
| 113 |
The `!` operator previously called `Self::from_bits_truncate`, which would truncate any bits that only partially |
| 114 |
overlapped with a valid flag. It will now use `bits & Self::all().bits()`, so any bits that overlap any bits |
| 115 |
specified by any flag will be respected. This is unlikely to have any practical implications, but enables defining |
| 116 |
a flag like `const ALL = !0` as a way to signal that any bit pattern is a known set of flags. |
| 117 |
|
| 118 |
## Changes to formatting |
| 119 |
|
| 120 |
Zero-valued flags will never be printed. You'll either get `0x0` for empty flags using debug formatting, or the |
| 121 |
set of flags with zero-valued flags omitted for others. |
| 122 |
|
| 123 |
Composite flags will no longer be redundantly printed if there are extra bits to print at the end that don't correspond |
| 124 |
to a valid flag. |
| 125 |
|
| 126 |
## What's Changed |
| 127 |
* Fix up incorrect sub assign behavior and other cleanups by @KodrAus in https://github.com/bitflags/bitflags/pull/366 |
| 128 |
|
| 129 |
**Full Changelog**: https://github.com/bitflags/bitflags/compare/2.3.2...2.3.3 |
| 130 |
|
| 131 |
# 2.3.2 |
| 132 |
|
| 133 |
## What's Changed |
| 134 |
* [doc] [src/lib.rs] delete redundant path prefix by @OccupyMars2025 in https://github.com/bitflags/bitflags/pull/361 |
| 135 |
|
| 136 |
## New Contributors |
| 137 |
* @OccupyMars2025 made their first contribution in https://github.com/bitflags/bitflags/pull/361 |
| 138 |
|
| 139 |
**Full Changelog**: https://github.com/bitflags/bitflags/compare/2.3.1...2.3.2 |
| 140 |
|
| 141 |
# 2.3.1 |
| 142 |
|
| 143 |
## What's Changed |
| 144 |
* Fix Self in flags value expressions by @KodrAus in https://github.com/bitflags/bitflags/pull/355 |
| 145 |
|
| 146 |
**Full Changelog**: https://github.com/bitflags/bitflags/compare/2.3.0...2.3.1 |
| 147 |
|
| 148 |
# 2.3.0 |
| 149 |
|
| 150 |
## Major changes |
| 151 |
|
| 152 |
### `BitFlags` trait deprecated in favor of `Flags` trait |
| 153 |
|
| 154 |
This release introduces the `Flags` trait and deprecates the `BitFlags` trait. These two traits are semver compatible so if you have public API code depending on `BitFlags` you can move to `Flags` without breaking end-users. This is possible because the `BitFlags` trait was never publicly implementable, so it now carries `Flags` as a supertrait. All implementations of `Flags` additionally implement `BitFlags`. |
| 155 |
|
| 156 |
The `Flags` trait is a publicly implementable version of the old `BitFlags` trait. The original `BitFlags` trait carried some macro baggage that made it difficult to implement, so a new `Flags` trait has been introduced as the _One True Trait_ for interacting with flags types generically. See the the `macro_free` and `custom_derive` examples for more details. |
| 157 |
|
| 158 |
### `Bits` trait publicly exposed |
| 159 |
|
| 160 |
The `Bits` trait for the underlying storage of flags values is also now publicly implementable. This lets you define your own exotic backing storage for flags. See the `custom_bits_type` example for more details. |
| 161 |
|
| 162 |
## What's Changed |
| 163 |
* Use explicit hashes for actions steps by @KodrAus in https://github.com/bitflags/bitflags/pull/350 |
| 164 |
* Support ejecting flags types from the bitflags macro by @KodrAus in https://github.com/bitflags/bitflags/pull/351 |
| 165 |
|
| 166 |
**Full Changelog**: https://github.com/bitflags/bitflags/compare/2.2.1...2.3.0 |
| 167 |
|
| 168 |
# 2.2.1 |
| 169 |
|
| 170 |
## What's Changed |
| 171 |
* Refactor attribute filtering to apply per-flag by @KodrAus in https://github.com/bitflags/bitflags/pull/345 |
| 172 |
|
| 173 |
**Full Changelog**: https://github.com/bitflags/bitflags/compare/2.2.0...2.2.1 |
| 174 |
|
| 175 |
# 2.2.0 |
| 176 |
|
| 177 |
## What's Changed |
| 178 |
* Create SECURITY.md by @KodrAus in https://github.com/bitflags/bitflags/pull/338 |
| 179 |
* add docs to describe the behavior of multi-bit flags by @nicholasbishop in https://github.com/bitflags/bitflags/pull/340 |
| 180 |
* Add support for bytemuck by @KodrAus in https://github.com/bitflags/bitflags/pull/336 |
| 181 |
* Add a top-level macro for filtering attributes by @KodrAus in https://github.com/bitflags/bitflags/pull/341 |
| 182 |
|
| 183 |
## New Contributors |
| 184 |
* @nicholasbishop made their first contribution in https://github.com/bitflags/bitflags/pull/340 |
| 185 |
|
| 186 |
**Full Changelog**: https://github.com/bitflags/bitflags/compare/2.1.0...2.2.0 |
| 187 |
|
| 188 |
# 2.1.0 |
| 189 |
|
| 190 |
## What's Changed |
| 191 |
* Add docs for the internal Field0 and examples of formatting/parsing by @KodrAus in https://github.com/bitflags/bitflags/pull/328 |
| 192 |
* Add support for arbitrary by @KodrAus in https://github.com/bitflags/bitflags/pull/324 |
| 193 |
* Fix up missing docs for consts within consts by @KodrAus in https://github.com/bitflags/bitflags/pull/330 |
| 194 |
* Ignore clippy lint in generated code by @Jake-Shadle in https://github.com/bitflags/bitflags/pull/331 |
| 195 |
|
| 196 |
## New Contributors |
| 197 |
* @Jake-Shadle made their first contribution in https://github.com/bitflags/bitflags/pull/331 |
| 198 |
|
| 199 |
**Full Changelog**: https://github.com/bitflags/bitflags/compare/2.0.2...2.1.0 |
| 200 |
|
| 201 |
# 2.0.2 |
| 202 |
|
| 203 |
## What's Changed |
| 204 |
* Fix up missing isize and usize Bits impls by @KodrAus in https://github.com/bitflags/bitflags/pull/321 |
| 205 |
|
| 206 |
**Full Changelog**: https://github.com/bitflags/bitflags/compare/2.0.1...2.0.2 |
| 207 |
|
| 208 |
# 2.0.1 |
| 209 |
|
| 210 |
## What's Changed |
| 211 |
* Fix up some docs issues by @KodrAus in https://github.com/bitflags/bitflags/pull/309 |
| 212 |
* Make empty_flag() const. by @tormeh in https://github.com/bitflags/bitflags/pull/313 |
| 213 |
* Fix formatting of multi-bit flags with partial overlap by @KodrAus in https://github.com/bitflags/bitflags/pull/316 |
| 214 |
|
| 215 |
## New Contributors |
| 216 |
* @tormeh made their first contribution in https://github.com/bitflags/bitflags/pull/313 |
| 217 |
|
| 218 |
**Full Changelog**: https://github.com/bitflags/bitflags/compare/2.0.0...2.0.1 |
| 219 |
|
| 220 |
# 2.0.0 |
| 221 |
|
| 222 |
## Major changes |
| 223 |
|
| 224 |
This release includes some major changes over `1.x`. If you use `bitflags!` types in your public API then upgrading this library may cause breakage in your downstream users. |
| 225 |
|
| 226 |
### ⚠️ Serialization |
| 227 |
|
| 228 |
You'll need to add the `serde` Cargo feature in order to `#[derive(Serialize, Deserialize)]` on your generated flags types: |
| 229 |
|
| 230 |
```rust |
| 231 |
bitflags! { |
| 232 |
#[derive(Serialize, Deserialize)] |
| 233 |
#[serde(transparent)] |
| 234 |
pub struct Flags: T { |
| 235 |
.. |
| 236 |
} |
| 237 |
} |
| 238 |
``` |
| 239 |
|
| 240 |
where `T` is the underlying bits type you're using, such as `u32`. |
| 241 |
|
| 242 |
The default serialization format with `serde` **has changed** if you `#[derive(Serialize, Deserialize)]` on your generated flags types. It will now use a formatted string for human-readable formats and the underlying bits type for compact formats. |
| 243 |
|
| 244 |
To keep the old format, see the https://github.com/KodrAus/bitflags-serde-legacy library. |
| 245 |
|
| 246 |
### ⚠️ Traits |
| 247 |
|
| 248 |
Generated flags types now derive fewer traits. If you need to maintain backwards compatibility, you can derive the following yourself: |
| 249 |
|
| 250 |
```rust |
| 251 |
#[derive(PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Clone, Copy)] |
| 252 |
``` |
| 253 |
|
| 254 |
### ⚠️ Methods |
| 255 |
|
| 256 |
The unsafe `from_bits_unchecked` method is now a safe `from_bits_retain` method. |
| 257 |
|
| 258 |
You can add the following method to your generated types to keep them compatible: |
| 259 |
|
| 260 |
```rust |
| 261 |
#[deprecated = "use the safe `from_bits_retain` method instead"] |
| 262 |
pub unsafe fn from_bits_unchecked(bits: T) -> Self { |
| 263 |
Self::from_bits_retain(bits) |
| 264 |
} |
| 265 |
``` |
| 266 |
|
| 267 |
where `T` is the underlying bits type you're using, such as `u32`. |
| 268 |
|
| 269 |
### ⚠️ `.bits` field |
| 270 |
|
| 271 |
You can now use the `.bits()` method instead of the old `.bits`. |
| 272 |
|
| 273 |
The representation of generated flags types has changed from a struct with the single field `bits` to a newtype. |
| 274 |
|
| 275 |
## What's Changed |
| 276 |
* Fix a typo and call out MSRV bump by @KodrAus in https://github.com/bitflags/bitflags/pull/259 |
| 277 |
* BitFlags trait by @arturoc in https://github.com/bitflags/bitflags/pull/220 |
| 278 |
* Add a hidden trait to discourage manual impls of BitFlags by @KodrAus in https://github.com/bitflags/bitflags/pull/261 |
| 279 |
* Sanitize `Ok` by @konsumlamm in https://github.com/bitflags/bitflags/pull/266 |
| 280 |
* Fix bug in `Debug` implementation by @konsumlamm in https://github.com/bitflags/bitflags/pull/268 |
| 281 |
* Fix a typo in the generated documentation by @wackbyte in https://github.com/bitflags/bitflags/pull/271 |
| 282 |
* Use SPDX license format by @atouchet in https://github.com/bitflags/bitflags/pull/272 |
| 283 |
* serde tests fail in CI by @arturoc in https://github.com/bitflags/bitflags/pull/277 |
| 284 |
* Fix beta test output by @KodrAus in https://github.com/bitflags/bitflags/pull/279 |
| 285 |
* Add example to the README.md file by @tiaanl in https://github.com/bitflags/bitflags/pull/270 |
| 286 |
* Iterator over all the enabled options by @arturoc in https://github.com/bitflags/bitflags/pull/278 |
| 287 |
* from_bits_(truncate) fail with composite flags by @arturoc in https://github.com/bitflags/bitflags/pull/276 |
| 288 |
* Add more platform coverage to CI by @KodrAus in https://github.com/bitflags/bitflags/pull/280 |
| 289 |
* rework the way cfgs are handled by @KodrAus in https://github.com/bitflags/bitflags/pull/281 |
| 290 |
* Split generated code into two types by @KodrAus in https://github.com/bitflags/bitflags/pull/282 |
| 291 |
* expose bitflags iters using nameable types by @KodrAus in https://github.com/bitflags/bitflags/pull/286 |
| 292 |
* Support creating flags from their names by @KodrAus in https://github.com/bitflags/bitflags/pull/287 |
| 293 |
* Update README.md by @KodrAus in https://github.com/bitflags/bitflags/pull/288 |
| 294 |
* Prepare for 2.0.0-rc.1 release by @KodrAus in https://github.com/bitflags/bitflags/pull/289 |
| 295 |
* Add missing "if" to contains doc-comment in traits.rs by @rusty-snake in https://github.com/bitflags/bitflags/pull/291 |
| 296 |
* Forbid unsafe_code by @fintelia in https://github.com/bitflags/bitflags/pull/294 |
| 297 |
* serde: enable no-std support by @nim65s in https://github.com/bitflags/bitflags/pull/296 |
| 298 |
* Add a parser for flags formatted as bar-separated-values by @KodrAus in https://github.com/bitflags/bitflags/pull/297 |
| 299 |
* Prepare for 2.0.0-rc.2 release by @KodrAus in https://github.com/bitflags/bitflags/pull/299 |
| 300 |
* Use strip_prefix instead of starts_with + slice by @QuinnPainter in https://github.com/bitflags/bitflags/pull/301 |
| 301 |
* Fix up some clippy lints by @KodrAus in https://github.com/bitflags/bitflags/pull/302 |
| 302 |
* Prepare for 2.0.0-rc.3 release by @KodrAus in https://github.com/bitflags/bitflags/pull/303 |
| 303 |
* feat: Add minimum permissions to rust.yml workflow by @gabibguti in https://github.com/bitflags/bitflags/pull/305 |
| 304 |
|
| 305 |
## New Contributors |
| 306 |
* @wackbyte made their first contribution in https://github.com/bitflags/bitflags/pull/271 |
| 307 |
* @atouchet made their first contribution in https://github.com/bitflags/bitflags/pull/272 |
| 308 |
* @tiaanl made their first contribution in https://github.com/bitflags/bitflags/pull/270 |
| 309 |
* @rusty-snake made their first contribution in https://github.com/bitflags/bitflags/pull/291 |
| 310 |
* @fintelia made their first contribution in https://github.com/bitflags/bitflags/pull/294 |
| 311 |
* @nim65s made their first contribution in https://github.com/bitflags/bitflags/pull/296 |
| 312 |
* @QuinnPainter made their first contribution in https://github.com/bitflags/bitflags/pull/301 |
| 313 |
* @gabibguti made their first contribution in https://github.com/bitflags/bitflags/pull/305 |
| 314 |
|
| 315 |
**Full Changelog**: https://github.com/bitflags/bitflags/compare/1.3.2...2.0.0 |
| 316 |
|
| 317 |
# 2.0.0-rc.3 |
| 318 |
|
| 319 |
## What's Changed |
| 320 |
* Use strip_prefix instead of starts_with + slice by @QuinnPainter in https://github.com/bitflags/bitflags/pull/301 |
| 321 |
* Fix up some clippy lints by @KodrAus in https://github.com/bitflags/bitflags/pull/302 |
| 322 |
|
| 323 |
## New Contributors |
| 324 |
* @QuinnPainter made their first contribution in https://github.com/bitflags/bitflags/pull/301 |
| 325 |
|
| 326 |
**Full Changelog**: https://github.com/bitflags/bitflags/compare/2.0.0-rc.2...2.0.0-rc.3 |
| 327 |
|
| 328 |
# 2.0.0-rc.2 |
| 329 |
|
| 330 |
## Changes to `serde` serialization |
| 331 |
|
| 332 |
**⚠️ NOTE ⚠️** This release changes the default serialization you'll get if you `#[derive(Serialize, Deserialize)]` |
| 333 |
on your generated flags types. It will now use a formatted string for human-readable formats and the underlying bits |
| 334 |
type for compact formats. |
| 335 |
|
| 336 |
To keep the old behavior, see the [`bitflags-serde-legacy`](https://github.com/KodrAus/bitflags-serde-legacy) library. |
| 337 |
|
| 338 |
## What's Changed |
| 339 |
|
| 340 |
* Add missing "if" to contains doc-comment in traits.rs by @rusty-snake in https://github.com/bitflags/bitflags/pull/291 |
| 341 |
* Forbid unsafe_code by @fintelia in https://github.com/bitflags/bitflags/pull/294 |
| 342 |
* serde: enable no-std support by @nim65s in https://github.com/bitflags/bitflags/pull/296 |
| 343 |
* Add a parser for flags formatted as bar-separated-values by @KodrAus in https://github.com/bitflags/bitflags/pull/297 |
| 344 |
|
| 345 |
## New Contributors |
| 346 |
* @rusty-snake made their first contribution in https://github.com/bitflags/bitflags/pull/291 |
| 347 |
* @fintelia made their first contribution in https://github.com/bitflags/bitflags/pull/294 |
| 348 |
* @nim65s made their first contribution in https://github.com/bitflags/bitflags/pull/296 |
| 349 |
|
| 350 |
**Full Changelog**: https://github.com/bitflags/bitflags/compare/2.0.0-rc.1...2.0.0-rc.2 |
| 351 |
|
| 352 |
# 2.0.0-rc.1 |
| 353 |
|
| 354 |
This is a big release including a few years worth of work on a new `BitFlags` trait, iteration, and better macro organization for future extensibility. |
| 355 |
|
| 356 |
## What's Changed |
| 357 |
* Fix a typo and call out MSRV bump by @KodrAus in https://github.com/bitflags/bitflags/pull/259 |
| 358 |
* BitFlags trait by @arturoc in https://github.com/bitflags/bitflags/pull/220 |
| 359 |
* Add a hidden trait to discourage manual impls of BitFlags by @KodrAus in https://github.com/bitflags/bitflags/pull/261 |
| 360 |
* Sanitize `Ok` by @konsumlamm in https://github.com/bitflags/bitflags/pull/266 |
| 361 |
* Fix bug in `Debug` implementation by @konsumlamm in https://github.com/bitflags/bitflags/pull/268 |
| 362 |
* Fix a typo in the generated documentation by @wackbyte in https://github.com/bitflags/bitflags/pull/271 |
| 363 |
* Use SPDX license format by @atouchet in https://github.com/bitflags/bitflags/pull/272 |
| 364 |
* serde tests fail in CI by @arturoc in https://github.com/bitflags/bitflags/pull/277 |
| 365 |
* Fix beta test output by @KodrAus in https://github.com/bitflags/bitflags/pull/279 |
| 366 |
* Add example to the README.md file by @tiaanl in https://github.com/bitflags/bitflags/pull/270 |
| 367 |
* Iterator over all the enabled options by @arturoc in https://github.com/bitflags/bitflags/pull/278 |
| 368 |
* from_bits_(truncate) fail with composite flags by @arturoc in https://github.com/bitflags/bitflags/pull/276 |
| 369 |
* Add more platform coverage to CI by @KodrAus in https://github.com/bitflags/bitflags/pull/280 |
| 370 |
* rework the way cfgs are handled by @KodrAus in https://github.com/bitflags/bitflags/pull/281 |
| 371 |
* Split generated code into two types by @KodrAus in https://github.com/bitflags/bitflags/pull/282 |
| 372 |
* expose bitflags iters using nameable types by @KodrAus in https://github.com/bitflags/bitflags/pull/286 |
| 373 |
* Support creating flags from their names by @KodrAus in https://github.com/bitflags/bitflags/pull/287 |
| 374 |
* Update README.md by @KodrAus in https://github.com/bitflags/bitflags/pull/288 |
| 375 |
|
| 376 |
## New Contributors |
| 377 |
* @wackbyte made their first contribution in https://github.com/bitflags/bitflags/pull/271 |
| 378 |
* @atouchet made their first contribution in https://github.com/bitflags/bitflags/pull/272 |
| 379 |
* @tiaanl made their first contribution in https://github.com/bitflags/bitflags/pull/270 |
| 380 |
|
| 381 |
**Full Changelog**: https://github.com/bitflags/bitflags/compare/1.3.2...2.0.0-rc.1 |
| 382 |
|
| 383 |
# 1.3.2 |
| 384 |
|
| 385 |
- Allow `non_snake_case` in generated flags types ([#256]) |
| 386 |
|
| 387 |
[#256]: https://github.com/bitflags/bitflags/pull/256 |
| 388 |
|
| 389 |
# 1.3.1 |
| 390 |
|
| 391 |
- Revert unconditional `#[repr(transparent)]` ([#252]) |
| 392 |
|
| 393 |
[#252]: https://github.com/bitflags/bitflags/pull/252 |
| 394 |
|
| 395 |
# 1.3.0 (yanked) |
| 396 |
|
| 397 |
**This release bumps the Minimum Supported Rust Version to `1.46.0`** |
| 398 |
|
| 399 |
- Add `#[repr(transparent)]` ([#187]) |
| 400 |
|
| 401 |
- End `empty` doc comment with full stop ([#202]) |
| 402 |
|
| 403 |
- Fix typo in crate root docs ([#206]) |
| 404 |
|
| 405 |
- Document from_bits_unchecked unsafety ([#207]) |
| 406 |
|
| 407 |
- Let `is_all` ignore extra bits ([#211]) |
| 408 |
|
| 409 |
- Allows empty flag definition ([#225]) |
| 410 |
|
| 411 |
- Making crate accessible from std ([#227]) |
| 412 |
|
| 413 |
- Make `from_bits` a const fn ([#229]) |
| 414 |
|
| 415 |
- Allow multiple bitflags structs in one macro invocation ([#235]) |
| 416 |
|
| 417 |
- Add named functions to perform set operations ([#244]) |
| 418 |
|
| 419 |
- Fix typos in method docs ([#245]) |
| 420 |
|
| 421 |
- Modernization of the `bitflags` macro to take advantage of newer features and 2018 idioms ([#246]) |
| 422 |
|
| 423 |
- Fix regression (in an unreleased feature) and simplify tests ([#247]) |
| 424 |
|
| 425 |
- Use `Self` and fix bug when overriding `stringify!` ([#249]) |
| 426 |
|
| 427 |
[#187]: https://github.com/bitflags/bitflags/pull/187 |
| 428 |
[#202]: https://github.com/bitflags/bitflags/pull/202 |
| 429 |
[#206]: https://github.com/bitflags/bitflags/pull/206 |
| 430 |
[#207]: https://github.com/bitflags/bitflags/pull/207 |
| 431 |
[#211]: https://github.com/bitflags/bitflags/pull/211 |
| 432 |
[#225]: https://github.com/bitflags/bitflags/pull/225 |
| 433 |
[#227]: https://github.com/bitflags/bitflags/pull/227 |
| 434 |
[#229]: https://github.com/bitflags/bitflags/pull/229 |
| 435 |
[#235]: https://github.com/bitflags/bitflags/pull/235 |
| 436 |
[#244]: https://github.com/bitflags/bitflags/pull/244 |
| 437 |
[#245]: https://github.com/bitflags/bitflags/pull/245 |
| 438 |
[#246]: https://github.com/bitflags/bitflags/pull/246 |
| 439 |
[#247]: https://github.com/bitflags/bitflags/pull/247 |
| 440 |
[#249]: https://github.com/bitflags/bitflags/pull/249 |
| 441 |
|
| 442 |
# 1.2.1 |
| 443 |
|
| 444 |
- Remove extraneous `#[inline]` attributes ([#194]) |
| 445 |
|
| 446 |
[#194]: https://github.com/bitflags/bitflags/pull/194 |
| 447 |
|
| 448 |
# 1.2.0 |
| 449 |
|
| 450 |
- Fix typo: {Lower, Upper}Exp - {Lower, Upper}Hex ([#183]) |
| 451 |
|
| 452 |
- Add support for "unknown" bits ([#188]) |
| 453 |
|
| 454 |
[#183]: https://github.com/rust-lang-nursery/bitflags/pull/183 |
| 455 |
[#188]: https://github.com/rust-lang-nursery/bitflags/pull/188 |
| 456 |
|
| 457 |
# 1.1.0 |
| 458 |
|
| 459 |
This is a re-release of `1.0.5`, which was yanked due to a bug in the RLS. |
| 460 |
|
| 461 |
# 1.0.5 |
| 462 |
|
| 463 |
- Use compiletest_rs flags supported by stable toolchain ([#171]) |
| 464 |
|
| 465 |
- Put the user provided attributes first ([#173]) |
| 466 |
|
| 467 |
- Make bitflags methods `const` on newer compilers ([#175]) |
| 468 |
|
| 469 |
[#171]: https://github.com/rust-lang-nursery/bitflags/pull/171 |
| 470 |
[#173]: https://github.com/rust-lang-nursery/bitflags/pull/173 |
| 471 |
[#175]: https://github.com/rust-lang-nursery/bitflags/pull/175 |
| 472 |
|
| 473 |
# 1.0.4 |
| 474 |
|
| 475 |
- Support Rust 2018 style macro imports ([#165]) |
| 476 |
|
| 477 |
```rust |
| 478 |
use bitflags::bitflags; |
| 479 |
``` |
| 480 |
|
| 481 |
[#165]: https://github.com/rust-lang-nursery/bitflags/pull/165 |
| 482 |
|
| 483 |
# 1.0.3 |
| 484 |
|
| 485 |
- Improve zero value flag handling and documentation ([#157]) |
| 486 |
|
| 487 |
[#157]: https://github.com/rust-lang-nursery/bitflags/pull/157 |
| 488 |
|
| 489 |
# 1.0.2 |
| 490 |
|
| 491 |
- 30% improvement in compile time of bitflags crate ([#156]) |
| 492 |
|
| 493 |
- Documentation improvements ([#153]) |
| 494 |
|
| 495 |
- Implementation cleanup ([#149]) |
| 496 |
|
| 497 |
[#156]: https://github.com/rust-lang-nursery/bitflags/pull/156 |
| 498 |
[#153]: https://github.com/rust-lang-nursery/bitflags/pull/153 |
| 499 |
[#149]: https://github.com/rust-lang-nursery/bitflags/pull/149 |
| 500 |
|
| 501 |
# 1.0.1 |
| 502 |
- Add support for `pub(restricted)` specifier on the bitflags struct ([#135]) |
| 503 |
- Optimize performance of `all()` when called from a separate crate ([#136]) |
| 504 |
|
| 505 |
[#135]: https://github.com/rust-lang-nursery/bitflags/pull/135 |
| 506 |
[#136]: https://github.com/rust-lang-nursery/bitflags/pull/136 |
| 507 |
|
| 508 |
# 1.0.0 |
| 509 |
- **[breaking change]** Macro now generates [associated constants](https://doc.rust-lang.org/reference/items.html#associated-constants) ([#24]) |
| 510 |
|
| 511 |
- **[breaking change]** Minimum supported version is Rust **1.20**, due to usage of associated constants |
| 512 |
|
| 513 |
- After being broken in 0.9, the `#[deprecated]` attribute is now supported again ([#112]) |
| 514 |
|
| 515 |
- Other improvements to unit tests and documentation ([#106] and [#115]) |
| 516 |
|
| 517 |
[#24]: https://github.com/rust-lang-nursery/bitflags/pull/24 |
| 518 |
[#106]: https://github.com/rust-lang-nursery/bitflags/pull/106 |
| 519 |
[#112]: https://github.com/rust-lang-nursery/bitflags/pull/112 |
| 520 |
[#115]: https://github.com/rust-lang-nursery/bitflags/pull/115 |
| 521 |
|
| 522 |
## How to update your code to use associated constants |
| 523 |
Assuming the following structure definition: |
| 524 |
```rust |
| 525 |
bitflags! { |
| 526 |
struct Something: u8 { |
| 527 |
const FOO = 0b01, |
| 528 |
const BAR = 0b10 |
| 529 |
} |
| 530 |
} |
| 531 |
``` |
| 532 |
In 0.9 and older you could do: |
| 533 |
```rust |
| 534 |
let x = FOO.bits | BAR.bits; |
| 535 |
``` |
| 536 |
Now you must use: |
| 537 |
```rust |
| 538 |
let x = Something::FOO.bits | Something::BAR.bits; |
| 539 |
``` |
| 540 |
|
| 541 |
# 0.9.1 |
| 542 |
- Fix the implementation of `Formatting` traits when other formatting traits were present in scope ([#105]) |
| 543 |
|
| 544 |
[#105]: https://github.com/rust-lang-nursery/bitflags/pull/105 |
| 545 |
|
| 546 |
# 0.9.0 |
| 547 |
- **[breaking change]** Use struct keyword instead of flags to define bitflag types ([#84]) |
| 548 |
|
| 549 |
- **[breaking change]** Terminate const items with semicolons instead of commas ([#87]) |
| 550 |
|
| 551 |
- Implement the `Hex`, `Octal`, and `Binary` formatting traits ([#86]) |
| 552 |
|
| 553 |
- Printing an empty flag value with the `Debug` trait now prints "(empty)" instead of nothing ([#85]) |
| 554 |
|
| 555 |
- The `bitflags!` macro can now be used inside of a fn body, to define a type local to that function ([#74]) |
| 556 |
|
| 557 |
[#74]: https://github.com/rust-lang-nursery/bitflags/pull/74 |
| 558 |
[#84]: https://github.com/rust-lang-nursery/bitflags/pull/84 |
| 559 |
[#85]: https://github.com/rust-lang-nursery/bitflags/pull/85 |
| 560 |
[#86]: https://github.com/rust-lang-nursery/bitflags/pull/86 |
| 561 |
[#87]: https://github.com/rust-lang-nursery/bitflags/pull/87 |
| 562 |
|
| 563 |
# 0.8.2 |
| 564 |
- Update feature flag used when building bitflags as a dependency of the Rust toolchain |
| 565 |
|
| 566 |
# 0.8.1 |
| 567 |
- Allow bitflags to be used as a dependency of the Rust toolchain |
| 568 |
|
| 569 |
# 0.8.0 |
| 570 |
- Add support for the experimental `i128` and `u128` integer types ([#57]) |
| 571 |
- Add set method: `flags.set(SOME_FLAG, true)` or `flags.set(SOME_FLAG, false)` ([#55]) |
| 572 |
This may break code that defines its own set method |
| 573 |
|
| 574 |
[#55]: https://github.com/rust-lang-nursery/bitflags/pull/55 |
| 575 |
[#57]: https://github.com/rust-lang-nursery/bitflags/pull/57 |
| 576 |
|
| 577 |
# 0.7.1 |
| 578 |
*(yanked)* |
| 579 |
|
| 580 |
# 0.7.0 |
| 581 |
- Implement the Extend trait ([#49]) |
| 582 |
- Allow definitions inside the `bitflags!` macro to refer to items imported from other modules ([#51]) |
| 583 |
|
| 584 |
[#49]: https://github.com/rust-lang-nursery/bitflags/pull/49 |
| 585 |
[#51]: https://github.com/rust-lang-nursery/bitflags/pull/51 |
| 586 |
|
| 587 |
# 0.6.0 |
| 588 |
- The `no_std` feature was removed as it is now the default |
| 589 |
- The `assignment_operators` feature was remove as it is now enabled by default |
| 590 |
- Some clippy suggestions have been applied |