@@ -422,14 +422,14 @@ pub use crate::const_api::ConstToken;
422
422
/// `BitFlags<T>` is marked with the `#[repr(transparent)]` trait, meaning
423
423
/// it can be safely transmuted into the corresponding numeric type.
424
424
///
425
- /// Usually, the same can be achieved by using [`BitFlags::from_bits`],
426
- /// [`BitFlags::from_bits_truncate`] or [`BitFlags::from_bits_unchecked`],
427
- /// but transmuting might still be useful if, for example, you're dealing with
425
+ /// Usually, the same can be achieved by using [`BitFlags::bits`] in one
426
+ /// direction, and [`BitFlags::from_bits`], [`BitFlags::from_bits_truncate`],
427
+ /// or [`BitFlags::from_bits_unchecked`] in the other direction. However,
428
+ /// transmuting might still be useful if, for example, you're dealing with
428
429
/// an entire array of `BitFlags`.
429
430
///
430
- /// Transmuting from a numeric type into `BitFlags` may also be done, but
431
- /// care must be taken to make sure that each set bit in the value corresponds
432
- /// to an existing flag
431
+ /// When transmuting *into* a `BitFlags`, make sure that each set bit
432
+ /// corresponds to an existing flag
433
433
/// (cf. [`from_bits_unchecked`][BitFlags::from_bits_unchecked]).
434
434
///
435
435
/// For example:
@@ -484,6 +484,9 @@ pub use crate::const_api::ConstToken;
484
484
/// }
485
485
/// ```
486
486
///
487
+ /// Manually providing a type for the `N` type parameter shouldn't ever
488
+ /// be necessary.
489
+ ///
487
490
/// The types substituted for `T` and `N` must always match, creating a
488
491
/// `BitFlags` value where that isn't the case is only possible with
489
492
/// incorrect unsafe code.
0 commit comments