mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-30 02:33:55 +00:00
22 lines
275 B
Rust
22 lines
275 B
Rust
// run-pass
|
|
|
|
#![warn(pointer_structural_match)]
|
|
#![allow(dead_code)]
|
|
const C: *const u8 = &0;
|
|
|
|
fn foo(x: *const u8) {
|
|
match x {
|
|
C => {}
|
|
_ => {}
|
|
}
|
|
}
|
|
|
|
const D: *const [u8; 4] = b"abcd";
|
|
|
|
fn main() {
|
|
match D {
|
|
D => {}
|
|
_ => {}
|
|
}
|
|
}
|