ghost 0.1.20

Define your own PhantomData
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#![allow(clippy::no_effect_underscore_binding)]

use ghost::phantom;

pub trait Trait<T> {}

#[phantom]
pub struct Independent<W: ?Sized, const I: u32>;

#[phantom]
pub struct Dependent<const I: usize, T: Trait<[u8; I]>>;

#[test]
fn test_const() {
    let _phantom_v = Independent::<i8, 0>;
    let _phantom_t: Independent<i8, 0> = Independent;
}