1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
// check-pass #![allow(dead_code)] use std::rc::Rc; fn test1() -> Rc<dyn for<'a> Fn(&'a usize) + 'static> { if let Some(_) = Some(1) { loop{} } else { loop{} } } fn test2() -> *mut (dyn for<'a> Fn(&'a usize) + 'static) { if let Some(_) = Some(1) { loop{} } else { loop{} } } fn main() {}