We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
coroutine
1 parent ed010dd commit 33cb334Copy full SHA for 33cb334
tests/ui/coroutine/invalid_attr_usage.rs
@@ -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
10
11
+fn main() {}
tests/ui/coroutine/invalid_attr_usage.stderr
@@ -0,0 +1,14 @@
+error: attribute should be applied to closures
+ --> $DIR/invalid_attr_usage.rs:5:1
+ |
+LL | #[coroutine]
+ | ^^^^^^^^^^^^
+ --> $DIR/invalid_attr_usage.rs:9:1
12
13
+error: aborting due to 2 previous errors
14
0 commit comments