mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-27 18:57:42 +03:00
Error on using yield without also using #[coroutine] on the closure
And suggest adding the `#[coroutine]` to the closure
This commit is contained in:
@@ -63,7 +63,7 @@
|
||||
// cdb-check: b : Returned [Type: enum2$<coroutine_objects::main::coroutine_env$0>]
|
||||
// cdb-check: [+0x[...]] _ref__a : 0x[...] : 6 [Type: int *]
|
||||
|
||||
#![feature(omit_gdb_pretty_printer_section, coroutines, coroutine_trait)]
|
||||
#![feature(omit_gdb_pretty_printer_section, coroutines, coroutine_trait, stmt_expr_attributes)]
|
||||
#![omit_gdb_pretty_printer_section]
|
||||
|
||||
use std::ops::Coroutine;
|
||||
@@ -71,7 +71,8 @@
|
||||
|
||||
fn main() {
|
||||
let mut a = 5;
|
||||
let mut b = || {
|
||||
let mut b = #[coroutine]
|
||||
|| {
|
||||
let mut c = 6;
|
||||
let mut d = 7;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user