Skip to content

Commit

Permalink
add test for repr(128) enum derives
Browse files Browse the repository at this point in the history
  • Loading branch information
lcnr committed May 19, 2020
1 parent d6cb540 commit 08b9b97
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/test/ui/enum-discriminant/issue-70509-partial_eq.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// run-pass
#![feature(repr128, arbitrary_enum_discriminant)]

#[derive(PartialEq, Debug)]
#[repr(i128)]
enum Test {
A(Box<u64>) = 0,
B(usize) = u64::max_value() as i128 + 1,
}

fn main() {
assert_ne!(Test::A(Box::new(2)), Test::B(0));
// This previously caused a segfault.
//
// See https://github.com/rust-lang/rust/issues/70509#issuecomment-620654186
// for a detailed explanation.
}

0 comments on commit 08b9b97

Please sign in to comment.