Make AnyBitPattern derive work for generic structs (#101)

* Allow generic structs to use `AnyBitPattern` derive.

* Attempt to nudge the CI into retrying.
This commit is contained in:
C. K. Young 2023-03-23 20:22:56 -04:00 committed by GitHub
parent b41f4cc1af
commit 8391afa876
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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
@ -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]