//@ known-bug: #122044 use std::hint::black_box; trait Func { type Ret: Id; } trait Id { type Assoc; } impl Id for u32 {} impl Id for u32 {} impl R, R: Id> Func for F { type Ret = R; } fn bar() -> impl Copy + Id { 0u32 } struct Foo { _func: T, value: Option<<::Ret as Id>::Assoc>, } fn main() { let mut fn_def = black_box(Foo { _func: bar, value: None, }); let fn_ptr = black_box(Foo { _func: bar as fn() -> _, value: None, }); fn_def.value = fn_ptr.value; }