rust/tests/ui/coroutine/issue-64620-yield-array-element.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

11 lines
223 B
Rust
Raw Normal View History

2020-03-09 00:12:41 +00:00
// Regression test for #64620
2023-10-19 21:46:28 +00:00
#![feature(coroutines)]
2020-03-09 00:12:41 +00:00
pub fn crash(arr: [usize; 1]) {
2023-10-19 21:46:28 +00:00
yield arr[0]; //~ ERROR: yield expression outside of coroutine literal
//~^ ERROR: `yield` can only be used in
2020-03-09 00:12:41 +00:00
}
fn main() {}