Rollup merge of #74623 - lcnr:polymorphize-functions, r=eddyb

polymorphize GlobalAlloc::Function

this sadly does not change #74614

r? @eddyb
This commit is contained in:
Yuki Okushi 2020-07-24 18:56:31 +09:00 committed by GitHub
commit a02aecba21
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 1 deletions

View file

@ -0,0 +1,13 @@
// run-pass
fn fop<T>() {}
fn bar<T>() -> &'static fn() {
&(fop::<T> as fn())
}
pub const FN: &'static fn() = &(fop::<i32> as fn());
fn main() {
bar::<u32>();
bar::<i32>();
(FN)();
}