about summary refs log tree commit diff
path: root/tests/ui/consts/const-eval/ice-generic-assoc-const.rs
blob: d758435bb203e9230fda99d2ffa07f337970ae4d (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
    }
}