about summary refs log tree commit diff
path: root/src/tools/miri/tests/fail/intrinsic_fallback_is_spec.rs
blob: e95ef4d9062ae1fabf6386342d0007e70c26049f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#![feature(intrinsics, rustc_attrs)]

#[rustc_intrinsic]
#[rustc_nounwind]
#[rustc_do_not_const_check]
#[inline]
pub const fn ptr_guaranteed_cmp<T>(ptr: *const T, other: *const T) -> u8 {
    (ptr == other) as u8
}

fn main() {
    ptr_guaranteed_cmp::<()>(std::ptr::null(), std::ptr::null());
    //~^ ERROR: can only use intrinsic fallback bodies that exactly reflect the specification
}