Skip to content

Commit 95d4785

Browse files
committed
Add test for issue-64620
1 parent 0005f29 commit 95d4785

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
// Regression test for #64620
2+
3+
#![feature(generators)]
4+
5+
pub fn crash(arr: [usize; 1]) {
6+
yield arr[0]; //~ ERROR: yield expression outside of generator literal
7+
}
8+
9+
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
error[E0627]: yield expression outside of generator literal
2+
--> $DIR/issue-64620-yield-array-element.rs:6:5
3+
|
4+
LL | yield arr[0];
5+
| ^^^^^^^^^^^^
6+
7+
error: aborting due to previous error
8+
9+
For more information about this error, try `rustc --explain E0627`.

0 commit comments

Comments
 (0)