Skip to content

Commit 97fcead

Browse files
committed
--bless tests
1 parent 40ae7b5 commit 97fcead

File tree

2 files changed

+42
-9
lines changed

2 files changed

+42
-9
lines changed
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
fn main() {
22
for<'a> |x: &'a u8| *x + 1;
3-
//~^ ERROR cannot introduce explicit parameters for a closure
3+
//~^ ERROR use of undeclared lifetime name `'a`
4+
//~^^ ERROR `for<...>` binders for closures are experimental
5+
//~^^^ ERROR `for<...>` binders for closures are not yet supported
46
}
57

68
enum Foo { Bar }
79
fn foo(x: impl Iterator<Item = Foo>) {
810
for <Foo>::Bar in x {}
911
//~^ ERROR expected one of `move`, `static`, `|`
12+
//~^^ ERROR `for<...>` binders for closures are experimental
1013
}
Lines changed: 38 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,46 @@
1-
error: cannot introduce explicit parameters for a closure
1+
error: expected one of `move`, `static`, `|`, or `||`, found `::`
2+
--> $DIR/recover-quantified-closure.rs:10:14
3+
|
4+
LL | for <Foo>::Bar in x {}
5+
| ^^ expected one of `move`, `static`, `|`, or `||`
6+
7+
error[E0261]: use of undeclared lifetime name `'a`
8+
--> $DIR/recover-quantified-closure.rs:2:18
9+
|
10+
LL | fn main() {
11+
| - help: consider introducing lifetime `'a` here: `<'a>`
12+
LL | for<'a> |x: &'a u8| *x + 1;
13+
| ^^ undeclared lifetime
14+
15+
error[E0658]: `for<...>` binders for closures are experimental
216
--> $DIR/recover-quantified-closure.rs:2:5
317
|
418
LL | for<'a> |x: &'a u8| *x + 1;
5-
| ^^^^^^^ ------------------ the parameters are attached to this closure
6-
| |
7-
| help: remove the parameters
19+
| ^^^^^^^
20+
|
21+
= note: see issue #97362 <https://github.com/rust-lang/rust/issues/97362> for more information
22+
= help: add `#![feature(closure_lifetime_binder)]` to the crate attributes to enable
23+
= help: consider removing `for<...>`
824

9-
error: expected one of `move`, `static`, `|`, or `||`, found `::`
10-
--> $DIR/recover-quantified-closure.rs:8:14
25+
error[E0658]: `for<...>` binders for closures are experimental
26+
--> $DIR/recover-quantified-closure.rs:10:5
1127
|
1228
LL | for <Foo>::Bar in x {}
13-
| ^^ expected one of `move`, `static`, `|`, or `||`
29+
| ^^^^^^^^^
30+
|
31+
= note: see issue #97362 <https://github.com/rust-lang/rust/issues/97362> for more information
32+
= help: add `#![feature(closure_lifetime_binder)]` to the crate attributes to enable
33+
= help: consider removing `for<...>`
34+
35+
error: `for<...>` binders for closures are not yet supported
36+
--> $DIR/recover-quantified-closure.rs:2:5
37+
|
38+
LL | for<'a> |x: &'a u8| *x + 1;
39+
| ^^^^^^^
40+
|
41+
= help: consider removing `for<...>`
1442

15-
error: aborting due to 2 previous errors
43+
error: aborting due to 5 previous errors
1644

45+
Some errors have detailed explanations: E0261, E0658.
46+
For more information about an error, try `rustc --explain E0261`.

0 commit comments

Comments
 (0)