Skip to content

Commit

Permalink
fixup! Fix clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
ModProg committed Aug 3, 2024
1 parent fcd4631 commit b061679
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
12 changes: 9 additions & 3 deletions tests/safety.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,13 @@ fn discriminant() {

assert_eq!(size_of::<isize>(), size_of_val(&discriminant(&Test::A)));

assert_eq!(0_isize, unsafe { transmute(discriminant(&Test::A)) });
assert_eq!(1_isize, unsafe { transmute(discriminant(&Test::B)) });
assert_eq!(2_isize, unsafe { transmute(discriminant(&Test::C)) });
assert_eq!(0_isize, unsafe {
transmute::<std::mem::Discriminant<Test>, isize>(discriminant(&Test::A))
});
assert_eq!(1_isize, unsafe {
transmute::<std::mem::Discriminant<Test>, isize>(discriminant(&Test::B))
});
assert_eq!(2_isize, unsafe {
transmute::<std::mem::Discriminant<Test>, isize>(discriminant(&Test::C))
});
}
1 change: 1 addition & 0 deletions tests/skip/field_trait.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![allow(unused)]
use std::cmp::Ordering;

use derive_where::derive_where;
Expand Down
1 change: 1 addition & 0 deletions tests/skip/struct_trait.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![allow(unused)]
use std::cmp::Ordering;

use derive_where::derive_where;
Expand Down
1 change: 1 addition & 0 deletions tests/skip/variant_trait.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#![allow(unused)]
use std::cmp::Ordering;

use derive_where::derive_where;
Expand Down

0 comments on commit b061679

Please sign in to comment.