Skip to content

Commit 3a334a0

Browse files
author
Sasha Pourcelot
committed
Add comment about ruby_style_closure status
1 parent dbe56f4 commit 3a334a0

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

src/test/ui/expr/malformed_closure/ruby_style_closure.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
// Part of issue #27300.
2+
// The problem here is that ruby-style closures are parsed as blocks whose
3+
// first statement is a closure. See the issue for more details:
4+
// https://github.com/rust-lang/rust/issues/27300
5+
6+
// Note: this test represents what the compiler currently emits. The error
7+
// message will be improved later.
8+
19
fn main() {
210
let p = Some(45).and_then({
311
//~^ expected a `FnOnce<({integer},)>` closure, found `Option<_>`

src/test/ui/expr/malformed_closure/ruby_style_closure.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
error[E0425]: cannot find value `x` in this scope
2-
--> $DIR/ruby_style_closure.rs:5:14
2+
--> $DIR/ruby_style_closure.rs:13:14
33
|
44
LL | Some(x * 2)
55
| ^ not found in this scope
66

77
error[E0277]: expected a `FnOnce<({integer},)>` closure, found `Option<_>`
8-
--> $DIR/ruby_style_closure.rs:2:22
8+
--> $DIR/ruby_style_closure.rs:10:22
99
|
1010
LL | let p = Some(45).and_then({
1111
| ^^^^^^^^ expected an `FnOnce<({integer},)>` closure, found `Option<_>`

0 commit comments

Comments
 (0)