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