Skip to content

Commit 33cb334

Browse files
oli-obkjieyouxu
authored andcommitted
Add test for coroutine attribute
1 parent ed010dd commit 33cb334

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed
+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
//! The `coroutine` attribute is only allowed on closures.
2+
3+
#![feature(coroutines)]
4+
5+
#[coroutine]
6+
//~^ ERROR: attribute should be applied to closures
7+
struct Foo;
8+
9+
#[coroutine]
10+
//~^ ERROR: attribute should be applied to closures
11+
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
error: attribute should be applied to closures
2+
--> $DIR/invalid_attr_usage.rs:5:1
3+
|
4+
LL | #[coroutine]
5+
| ^^^^^^^^^^^^
6+
7+
error: attribute should be applied to closures
8+
--> $DIR/invalid_attr_usage.rs:9:1
9+
|
10+
LL | #[coroutine]
11+
| ^^^^^^^^^^^^
12+
13+
error: aborting due to 2 previous errors
14+

0 commit comments

Comments
 (0)