2020-04-22 15:50:31 -05:00
|
|
|
// build-pass (tests post-monomorphisation failure)
|
|
|
|
#![crate_type = "lib"]
|
2018-06-27 11:24:24 -05:00
|
|
|
|
|
|
|
pub trait Nullable {
|
|
|
|
const NULL: Self;
|
|
|
|
|
|
|
|
fn is_null(&self) -> bool;
|
|
|
|
}
|
|
|
|
|
|
|
|
impl<T> Nullable for *const T {
|
2019-06-17 05:52:37 -05:00
|
|
|
const NULL: Self = core::ptr::null::<T>();
|
2018-06-27 11:24:24 -05:00
|
|
|
|
|
|
|
fn is_null(&self) -> bool {
|
|
|
|
*self == Self::NULL
|
|
|
|
}
|
|
|
|
}
|