]> git.lizzy.rs Git - rust.git/blob - src/test/ui/consts/const-eval/ice-generic-assoc-const.rs
Rollup merge of #71340 - Valloric:more-check-pass, r=nikomatsakis
[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 }