Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a hidden trait to discourage manual impls of BitFlags #261

Merged
merged 7 commits into from
Oct 26, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
add a stub doc to BitFlags
  • Loading branch information
KodrAus authored Oct 23, 2021
commit f0a2bf65d95e196a6f44e48af5ee160675784817
4 changes: 4 additions & 0 deletions src/bitflags_trait.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ use core as _core;
#[doc(hidden)]
pub trait ImplementedByBitFlagsMacro {}

/// A flags enum.
///
/// Manual implementations of this trait are not supported.
/// It should only be automatically implemented through the `bitflags!` macro.
KodrAus marked this conversation as resolved.
Show resolved Hide resolved
pub trait BitFlags: ImplementedByBitFlagsMacro {
type Bits;
/// Returns an empty set of flags.
Expand Down