Implement the `Fn` trait for bare fn pointers in the compiler rather than doing it using hard-coded impls. This means that it works also for more complex fn types involving bound regions. Fixes #19126.
Add a cache so we don't create so many shims.
Adjust nits from pcwalton.
auto merge of #19449 : nikomatsakis/rust/unboxed-closure-fn-impl, r=pcwalton

Implement the `Fn` trait for bare fn pointers in the compiler rather
than doing it using hard-coded impls. This means that it works also
for more complex fn types involving bound regions.