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