Skip to content

Commit

Permalink
Merge pull request #390 from KodrAus/fix/ci
Browse files Browse the repository at this point in the history
Update error messages
  • Loading branch information
KodrAus committed Dec 11, 2023
2 parents 4db18a8 + daa5dc0 commit 1687ebd
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/lib.rs
Expand Up @@ -252,6 +252,7 @@ mod traits;

#[doc(hidden)]
pub mod __private {
#[allow(unused_imports)] // Easier than conditionally checking any optional external dependencies
pub use crate::{external::__private::*, traits::__private::*};

pub use core;
Expand Down
9 changes: 9 additions & 0 deletions tests/compile-fail/bitflags_trait_custom.stderr
Expand Up @@ -29,3 +29,12 @@ note: required by a bound in `BitFlags`
|
| pub trait BitFlags: ImplementedByBitFlagsMacro + Flags {
| ^^^^^ required by this bound in `BitFlags`

error[E0046]: not all trait items implemented, missing: `Iter`, `IterNames`
--> tests/compile-fail/bitflags_trait_custom.rs:5:1
|
5 | impl BitFlags for BootlegFlags {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `Iter`, `IterNames` in implementation
|
= help: implement the missing item: `type Iter = /* Type */;`
= help: implement the missing item: `type IterNames = /* Type */;`
18 changes: 18 additions & 0 deletions tests/compile-fail/unnamed_const.stderr
Expand Up @@ -19,3 +19,21 @@ error[E0599]: no associated item named `_` found for struct `Unnamed` in the cur
8 | | }
9 | | }
| |_- associated item `_` not found for this struct
|
note: if you're trying to build a new `Unnamed` consider using one of the following associated functions:
_::<impl Unnamed>::empty
_::<impl Unnamed>::all
_::<impl Unnamed>::from_bits
_::<impl Unnamed>::from_bits_truncate
and $N others
--> tests/compile-fail/unnamed_const.rs:3:1
|
3 | / bitflags! {
4 | | pub struct Unnamed: u8 {
5 | | const _ = 1;
6 | |
7 | | const A = Self::_.bits();
8 | | }
9 | | }
| |_^
= note: this error originates in the macro `__impl_bitflags` which comes from the expansion of the macro `bitflags` (in Nightly builds, run with -Z macro-backtrace for more info)

0 comments on commit 1687ebd

Please sign in to comment.