]> git.lizzy.rs Git - rust.git/blob - src/test/ui/consts/const-eval/ice-generic-assoc-const.rs
Rollup merge of #70038 - DutchGhost:const-forget-tests, r=RalfJung
[rust.git] / src / test / ui / consts / const-eval / ice-generic-assoc-const.rs
1 // check-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 }