diff options
| author | bors <bors@rust-lang.org> | 2015-03-19 03:19:08 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2015-03-19 03:19:08 +0000 |
| commit | 0084f92302b3352372bfd14ebbf083bae695d16e (patch) | |
| tree | 7aeee112b2593dfc26968c2c3692371d9dc4a5ef /src/test/parse-fail | |
| parent | 12cb7c6a2847959460ecac75b2c983d071585472 (diff) | |
| parent | 6f930b99b0dbd548abb7bdd9eb9472d166f66811 (diff) | |
| download | rust-0084f92302b3352372bfd14ebbf083bae695d16e.tar.gz rust-0084f92302b3352372bfd14ebbf083bae695d16e.zip | |
Auto merge of #23502 - Manishearth:rollup, r=Manishearth
Diffstat (limited to 'src/test/parse-fail')
| -rw-r--r-- | src/test/parse-fail/closure-return-syntax.rs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/test/parse-fail/closure-return-syntax.rs b/src/test/parse-fail/closure-return-syntax.rs new file mode 100644 index 00000000000..da6245597f8 --- /dev/null +++ b/src/test/parse-fail/closure-return-syntax.rs @@ -0,0 +1,16 @@ +// Copyright 2014 The Rust Project Developers. See the COPYRIGHT +// file at the top-level directory of this distribution and at +// http://rust-lang.org/COPYRIGHT. +// +// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or +// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license +// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your +// option. This file may not be copied, modified, or distributed +// except according to those terms. + +// Test that we cannot parse a closure with an explicit return type +// unless it uses braces. + +fn main() { + let x = || -> i32 22; //~ ERROR expected `{`, found `22` +} |
