Skip to content

Commit

Permalink
Make AnyBitPattern derive work for generic structs (#101)
Browse files Browse the repository at this point in the history
* Allow generic structs to use `AnyBitPattern` derive.

* Attempt to nudge the CI into retrying.
  • Loading branch information
cky authored Mar 24, 2023
1 parent b41f4cc commit 8391afa
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions derive/tests/basic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,9 @@ struct CheckedBitPatternStruct {

#[derive(Debug, Copy, Clone, AnyBitPattern, PartialEq, Eq)]
#[repr(C)]
struct AnyBitPatternTest {
a: u16,
b: u16,
struct AnyBitPatternTest<A: AnyBitPattern, B: AnyBitPattern> {
a: A,
b: B,
}

/// ```compile_fail
Expand Down Expand Up @@ -259,8 +259,8 @@ fn passes_cast_struct() {

#[test]
fn anybitpattern_implies_zeroable() {
let test = AnyBitPatternTest::zeroed();
assert_eq!(test, AnyBitPatternTest { a: 0, b: 0 });
let test = AnyBitPatternTest::<isize, usize>::zeroed();
assert_eq!(test, AnyBitPatternTest { a: 0isize, b: 0usize });
}

#[test]
Expand Down

0 comments on commit 8391afa

Please sign in to comment.