rust/tests/ui/consts/const-eval/ice-generic-assoc-const.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

17 lines
302 B
Rust
Raw Normal View History

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