summaryrefslogtreecommitdiffstats
path: root/tests/ui/consts/const-eval/ice-generic-assoc-const.rs
blob: e514682af9c20276e31dee9a3f01cfbfcad9c479 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// 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
    }
}