Skip to content

Commit

Permalink
Add test for issue-64620
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnTitor committed Mar 9, 2020
1 parent 0005f29 commit 95d4785
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/test/ui/generator/issue-64620-yield-array-element.rs
Original file line number Diff line number Diff line change
@@ -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() {}
9 changes: 9 additions & 0 deletions src/test/ui/generator/issue-64620-yield-array-element.stderr
Original file line number Diff line number Diff line change
@@ -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`.

0 comments on commit 95d4785

Please sign in to comment.