2 use std::marker::PhantomData;
10 fn get_value(&self) -> i32;
13 impl<A> MetaTrait for Meta<A> {
14 fn get_value(&self) -> i32 { self.value }
18 fn get_const(&self) -> &dyn MetaTrait;
25 impl<A: 'static> Foo<A> {
26 const CONST: &'static dyn MetaTrait = &Meta::<Self> {
32 impl<A: 'static> Bar for Foo<A> {
33 fn get_const(&self) -> &dyn MetaTrait { Self::CONST }
37 let foo = Foo::<i32> { _value: 10 };
38 let bar: &dyn Bar = &foo;
39 println!("const {}", bar.get_const().get_value());