rust/src/test/ui/polymorphization/promoted-function.rs

14 lines
201 B
Rust
Raw Normal View History

2020-07-22 12:50:26 +02:00
// 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)();
}