mirror of
https://github.com/rust-lang/rust.git
synced 2025-05-14 02:49:40 +00:00
Add test for issue-64620
This commit is contained in:
parent
0005f29d89
commit
95d478546f
9
src/test/ui/generator/issue-64620-yield-array-element.rs
Normal file
9
src/test/ui/generator/issue-64620-yield-array-element.rs
Normal 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() {}
|
@ -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`.
|
Loading…
Reference in New Issue
Block a user