1
Fork 0

polymorphize GlobalAlloc::Function

This commit is contained in:
Bastian Kauschke 2020-07-22 12:50:26 +02:00
parent e22b61bff0
commit 6a9c5fb4cc
3 changed files with 15 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)();
}