Add test for issue-64620

This commit is contained in:
Yuki Okushi 2020-03-09 09:12:41 +09:00
parent 0005f29d89
commit 95d478546f
No known key found for this signature in database
GPG Key ID: B0986C85C0E2DAA1
2 changed files with 18 additions and 0 deletions

View File

@ -0,0 +1,9 @@
// Regression test for #64620
#![feature(generators)]
pub fn crash(arr: [usize; 1]) {
yield arr[0]; //~ ERROR: yield expression outside of generator literal
}
fn main() {}

View File

@ -0,0 +1,9 @@
error[E0627]: yield expression outside of generator literal
--> $DIR/issue-64620-yield-array-element.rs:6:5
|
LL | yield arr[0];
| ^^^^^^^^^^^^
error: aborting due to previous error
For more information about this error, try `rustc --explain E0627`.