// check-pass // compile-flags:-Zpolymorphize=on pub struct OnDrop(pub F); impl Drop for OnDrop { fn drop(&mut self) { } } fn foo( _: R, _: S, ) { let bar = || { let _ = OnDrop(|| ()); }; bar(); } fn main() { foo(3u32, || {}); }