diff options
Diffstat (limited to '')
-rw-r--r-- | src/test/ui/fn/fun-call-variants.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/test/ui/fn/fun-call-variants.rs b/src/test/ui/fn/fun-call-variants.rs new file mode 100644 index 000000000..5b83e2620 --- /dev/null +++ b/src/test/ui/fn/fun-call-variants.rs @@ -0,0 +1,12 @@ +// run-pass + +fn ho<F>(f: F) -> isize where F: FnOnce(isize) -> isize { let n: isize = f(3); return n; } + +fn direct(x: isize) -> isize { return x + 1; } + +pub fn main() { + let a: isize = direct(3); // direct + let b: isize = ho(direct); // indirect unbound + + assert_eq!(a, b); +} |