@@ -422,14 +422,14 @@ pub use crate::const_api::ConstToken;
422422/// `BitFlags<T>` is marked with the `#[repr(transparent)]` trait, meaning
423423/// it can be safely transmuted into the corresponding numeric type.
424424///
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
428429/// an entire array of `BitFlags`.
429430///
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
433433/// (cf. [`from_bits_unchecked`][BitFlags::from_bits_unchecked]).
434434///
435435/// For example:
@@ -484,6 +484,9 @@ pub use crate::const_api::ConstToken;
484484/// }
485485/// ```
486486///
487+ /// Manually providing a type for the `N` type parameter shouldn't ever
488+ /// be necessary.
489+ ///
487490/// The types substituted for `T` and `N` must always match, creating a
488491/// `BitFlags` value where that isn't the case is only possible with
489492/// incorrect unsafe code.
0 commit comments