]> git.lizzy.rs Git - rust.git/blob - src/test/ui/consts/const-eval/ice-generic-assoc-const.rs
Make use of `ptr::null(_mut)` instead of casting zero
[rust.git] / src / test / ui / consts / const-eval / ice-generic-assoc-const.rs
1 // compile-pass
2
3 pub trait Nullable {
4     const NULL: Self;
5
6     fn is_null(&self) -> bool;
7 }
8
9 impl<T> Nullable for *const T {
10     const NULL: Self = core::ptr::null::<T>();
11
12     fn is_null(&self) -> bool {
13         *self == Self::NULL
14     }
15 }
16
17 fn main() {
18 }