Rollup merge of #117636 - bvanjoi:fix-117626, r=TaKO8Ki
add test for #117626 Close #117626
This commit is contained in:
commit
5c47d77c1e
1 changed files with 21 additions and 0 deletions
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…
Add table
Add a link
Reference in a new issue