Add test for coroutine
attribute
This commit is contained in:
parent
ed010dd32c
commit
33cb33441d
11
tests/ui/coroutine/invalid_attr_usage.rs
Normal file
11
tests/ui/coroutine/invalid_attr_usage.rs
Normal file
@ -0,0 +1,11 @@
|
||||
//! The `coroutine` attribute is only allowed on closures.
|
||||
|
||||
#![feature(coroutines)]
|
||||
|
||||
#[coroutine]
|
||||
//~^ ERROR: attribute should be applied to closures
|
||||
struct Foo;
|
||||
|
||||
#[coroutine]
|
||||
//~^ ERROR: attribute should be applied to closures
|
||||
fn main() {}
|
14
tests/ui/coroutine/invalid_attr_usage.stderr
Normal file
14
tests/ui/coroutine/invalid_attr_usage.stderr
Normal file
@ -0,0 +1,14 @@
|
||||
error: attribute should be applied to closures
|
||||
--> $DIR/invalid_attr_usage.rs:5:1
|
||||
|
|
||||
LL | #[coroutine]
|
||||
| ^^^^^^^^^^^^
|
||||
|
||||
error: attribute should be applied to closures
|
||||
--> $DIR/invalid_attr_usage.rs:9:1
|
||||
|
|
||||
LL | #[coroutine]
|
||||
| ^^^^^^^^^^^^
|
||||
|
||||
error: aborting due to 2 previous errors
|
||||
|
Loading…
Reference in New Issue
Block a user