]> git.lizzy.rs Git - rust.git/blob - src/test/ui/consts/const-eval/ice-generic-assoc-const.rs
Merge commit 'bf1c6f9871f430e284b17aa44059e0d0395e28a6' into clippyup
[rust.git] / src / test / ui / consts / const-eval / ice-generic-assoc-const.rs
1 // build-pass (tests post-monomorphisation failure)
2 #![crate_type = "lib"]
3
4 pub trait Nullable {
5     const NULL: Self;
6
7     fn is_null(&self) -> bool;
8 }
9
10 impl<T> Nullable for *const T {
11     const NULL: Self = core::ptr::null::<T>();
12
13     fn is_null(&self) -> bool {
14         *self == Self::NULL
15     }
16 }