rustdoc: Use Fn trait sugar for external paths

Fix #19909