mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-28 02:57:37 +00:00
Rollup merge of #117636 - bvanjoi:fix-117626, r=TaKO8Ki
add test for #117626 Close #117626
This commit is contained in:
commit
5c47d77c1e
21
tests/ui/pattern/issue-117626.rs
Normal file
21
tests/ui/pattern/issue-117626.rs
Normal file
@ -0,0 +1,21 @@
|
||||
// check-pass
|
||||
|
||||
#[derive(PartialEq)]
|
||||
struct NonMatchable;
|
||||
|
||||
impl Eq for NonMatchable {}
|
||||
|
||||
#[derive(PartialEq, Eq)]
|
||||
enum Foo {
|
||||
A(NonMatchable),
|
||||
B(*const u8),
|
||||
}
|
||||
|
||||
const CONST: Foo = Foo::B(std::ptr::null());
|
||||
|
||||
fn main() {
|
||||
match CONST {
|
||||
CONST => 0,
|
||||
_ => 1,
|
||||
};
|
||||
}
|
Loading…
Reference in New Issue
Block a user