diff options
Diffstat (limited to '')
-rw-r--r-- | src/test/ui/fun-indirect-call.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/test/ui/fun-indirect-call.rs b/src/test/ui/fun-indirect-call.rs new file mode 100644 index 000000000..49da3d83f --- /dev/null +++ b/src/test/ui/fun-indirect-call.rs @@ -0,0 +1,9 @@ +// run-pass + +fn f() -> isize { return 42; } + +pub fn main() { + let g: fn() -> isize = f; + let i: isize = g(); + assert_eq!(i, 42); +} |