diff options
Diffstat (limited to 'src/test/ui/threads-sendsync/sendfn-is-a-block.rs')
-rw-r--r-- | src/test/ui/threads-sendsync/sendfn-is-a-block.rs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/test/ui/threads-sendsync/sendfn-is-a-block.rs b/src/test/ui/threads-sendsync/sendfn-is-a-block.rs new file mode 100644 index 000000000..62807d894 --- /dev/null +++ b/src/test/ui/threads-sendsync/sendfn-is-a-block.rs @@ -0,0 +1,11 @@ +// run-pass + + +fn test<F>(f: F) -> usize where F: FnOnce(usize) -> usize { + return f(22); +} + +pub fn main() { + let y = test(|x| 4 * x); + assert_eq!(y, 88); +} |