rust/tests/compile-fail/pointers_to_different_allocations_are_unorderable.rs

8 lines
169 B
Rust
Raw Normal View History

fn main() {
let x: *const u8 = &1;
let y: *const u8 = &2;
2018-10-19 04:50:17 -05:00
if x < y { //~ ERROR attempted to do invalid arithmetic on pointers
unreachable!()
}
}