diff options
Diffstat (limited to 'tests/ui/polymorphization/promoted-function.rs')
-rw-r--r-- | tests/ui/polymorphization/promoted-function.rs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/ui/polymorphization/promoted-function.rs b/tests/ui/polymorphization/promoted-function.rs new file mode 100644 index 000000000..a56a8e70e --- /dev/null +++ b/tests/ui/polymorphization/promoted-function.rs @@ -0,0 +1,15 @@ +// run-pass +// compile-flags:-Zpolymorphize=on + +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)(); +} |