-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Emit a proper error if bitflags enum is generic
This probably hasn't been hit by anyone but I noticed it in the AST, so...
- Loading branch information
1 parent
f3bb174
commit 561fe5e
Showing
3 changed files
with
26 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#[enumflags2::bitflags] | ||
#[repr(u8)] | ||
enum Foo<A> { | ||
Bar, | ||
} | ||
|
||
fn main() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
error: bitflags cannot be generic | ||
--> ui/with_generics.rs:3:9 | ||
| | ||
3 | enum Foo<A> { | ||
| ^^^ | ||
|
||
error[E0392]: type parameter `A` is never used | ||
--> ui/with_generics.rs:3:10 | ||
| | ||
3 | enum Foo<A> { | ||
| ^ unused type parameter | ||
| | ||
= help: consider removing `A`, referring to it in a field, or using a marker such as `PhantomData` | ||
= help: if you intended `A` to be a const parameter, use `const A: /* Type */` instead |