Skip to content

Commit 5658c28

Browse files
committed
Rename suspend to yield
1 parent 97f91ea commit 5658c28

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+97
-97
lines changed

src/librustc/cfg/construct.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,7 @@ impl<'a, 'tcx> CFGBuilder<'a, 'tcx> {
389389
hir::ExprUnary(_, ref e) |
390390
hir::ExprField(ref e, _) |
391391
hir::ExprTupField(ref e, _) |
392-
hir::ExprSuspend(ref e) |
392+
hir::ExprYield(ref e) |
393393
hir::ExprRepeat(ref e, _) => {
394394
self.straightline(expr, pred, Some(&**e).into_iter())
395395
}

src/librustc/hir/intravisit.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1045,7 +1045,7 @@ pub fn walk_expr<'v, V: Visitor<'v>>(visitor: &mut V, expression: &'v Expr) {
10451045
visitor.visit_expr(input)
10461046
}
10471047
}
1048-
ExprSuspend(ref subexpression) => {
1048+
ExprYield(ref subexpression) => {
10491049
visitor.visit_expr(subexpression);
10501050
}
10511051
ExprImplArg(id) => {

src/librustc/hir/lowering.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2108,7 +2108,7 @@ impl<'a> LoweringContext<'a> {
21082108
let expr = opt_expr.as_ref().map(|x| self.lower_expr(x)).unwrap_or_else(|| {
21092109
self.expr(e.span, hir::ExprTup(hir_vec![]), ThinVec::new())
21102110
});
2111-
hir::ExprSuspend(P(expr))
2111+
hir::ExprYield(P(expr))
21122112
}
21132113

21142114
ExprKind::ImplArg => {

src/librustc/hir/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1069,8 +1069,8 @@ pub enum Expr_ {
10691069
/// to be repeated; the second is the number of times to repeat it.
10701070
ExprRepeat(P<Expr>, BodyId),
10711071

1072-
/// A suspension point for generators
1073-
ExprSuspend(P<Expr>),
1072+
/// A suspension point for generators. This is `yield <expr>` in Rust.
1073+
ExprYield(P<Expr>),
10741074

10751075
/// The argument to a generator
10761076
ExprImplArg(NodeId),

src/librustc/hir/print.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1462,8 +1462,8 @@ impl<'a> State<'a> {
14621462

14631463
self.pclose()?;
14641464
}
1465-
hir::ExprSuspend(ref expr) => {
1466-
word(&mut self.s, "suspend ")?;
1465+
hir::ExprYield(ref expr) => {
1466+
word(&mut self.s, "yield ")?;
14671467
self.print_expr(&expr)?;
14681468
}
14691469
hir::ExprImplArg(_) => {

src/librustc/ich/impls_hir.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -573,7 +573,7 @@ impl<'a, 'gcx, 'tcx> HashStable<StableHashingContext<'a, 'gcx, 'tcx>> for hir::E
573573
hir::ExprBreak(..) |
574574
hir::ExprAgain(..) |
575575
hir::ExprRet(..) |
576-
hir::ExprSuspend(..) |
576+
hir::ExprYield(..) |
577577
hir::ExprImplArg(..) |
578578
hir::ExprInlineAsm(..) |
579579
hir::ExprRepeat(..) |
@@ -654,7 +654,7 @@ impl_stable_hash_for!(enum hir::Expr_ {
654654
ExprInlineAsm(asm, inputs, outputs),
655655
ExprStruct(path, fields, base),
656656
ExprRepeat(val, times),
657-
ExprSuspend(val),
657+
ExprYield(val),
658658
ExprImplArg(id)
659659
});
660660

src/librustc/ich/impls_mir.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ for mir::Terminator<'tcx> {
5858
mir::TerminatorKind::Unreachable |
5959
mir::TerminatorKind::Drop { .. } |
6060
mir::TerminatorKind::DropAndReplace { .. } |
61-
mir::TerminatorKind::Suspend { .. } |
61+
mir::TerminatorKind::Yield { .. } |
6262
mir::TerminatorKind::Call { .. } => false,
6363
};
6464

@@ -164,7 +164,7 @@ for mir::TerminatorKind<'tcx> {
164164
target.hash_stable(hcx, hasher);
165165
unwind.hash_stable(hcx, hasher);
166166
}
167-
mir::TerminatorKind::Suspend { ref value,
167+
mir::TerminatorKind::Yield { ref value,
168168
resume,
169169
drop } => {
170170
value.hash_stable(hcx, hasher);

src/librustc/ich/impls_ty.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ for ty::UpvarCapture<'tcx> {
144144

145145
impl_stable_hash_for!(struct ty::GenSig<'tcx> {
146146
impl_arg_ty,
147-
suspend_ty,
147+
yield_ty,
148148
return_ty
149149
});
150150

src/librustc/middle/expr_use_visitor.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,7 @@ impl<'a, 'gcx, 'tcx> ExprUseVisitor<'a, 'gcx, 'tcx> {
525525
self.consume_expr(&base);
526526
}
527527

528-
hir::ExprSuspend(ref value) => {
528+
hir::ExprYield(ref value) => {
529529
self.consume_expr(&value);
530530
}
531531

src/librustc/middle/liveness.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -470,7 +470,7 @@ fn visit_expr<'a, 'tcx>(ir: &mut IrMaps<'a, 'tcx>, expr: &'tcx Expr) {
470470
hir::ExprAgain(_) | hir::ExprLit(_) | hir::ExprRet(..) |
471471
hir::ExprBlock(..) | hir::ExprAssign(..) | hir::ExprAssignOp(..) |
472472
hir::ExprStruct(..) | hir::ExprRepeat(..) |
473-
hir::ExprInlineAsm(..) | hir::ExprBox(..) | hir::ExprSuspend(..) |
473+
hir::ExprInlineAsm(..) | hir::ExprBox(..) | hir::ExprYield(..) |
474474
hir::ExprType(..) | hir::ExprPath(hir::QPath::TypeRelative(..)) => {
475475
intravisit::walk_expr(ir, expr);
476476
}
@@ -1129,7 +1129,7 @@ impl<'a, 'tcx> Liveness<'a, 'tcx> {
11291129
hir::ExprCast(ref e, _) |
11301130
hir::ExprType(ref e, _) |
11311131
hir::ExprUnary(_, ref e) |
1132-
hir::ExprSuspend(ref e) |
1132+
hir::ExprYield(ref e) |
11331133
hir::ExprRepeat(ref e, _) => {
11341134
self.propagate_through_expr(&e, succ)
11351135
}
@@ -1420,7 +1420,7 @@ fn check_expr<'a, 'tcx>(this: &mut Liveness<'a, 'tcx>, expr: &'tcx Expr) {
14201420
hir::ExprBreak(..) | hir::ExprAgain(..) | hir::ExprLit(_) |
14211421
hir::ExprBlock(..) | hir::ExprAddrOf(..) |
14221422
hir::ExprStruct(..) | hir::ExprRepeat(..) | hir::ExprImplArg(_) |
1423-
hir::ExprClosure(..) | hir::ExprPath(_) | hir::ExprSuspend(..) |
1423+
hir::ExprClosure(..) | hir::ExprPath(_) | hir::ExprYield(..) |
14241424
hir::ExprBox(..) | hir::ExprType(..) => {
14251425
intravisit::walk_expr(this, expr);
14261426
}

src/librustc/middle/mem_categorization.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -620,7 +620,7 @@ impl<'a, 'gcx, 'tcx> MemCategorizationContext<'a, 'gcx, 'tcx> {
620620
hir::ExprAddrOf(..) | hir::ExprCall(..) |
621621
hir::ExprAssign(..) | hir::ExprAssignOp(..) |
622622
hir::ExprClosure(..) | hir::ExprRet(..) |
623-
hir::ExprUnary(..) | hir::ExprSuspend(..) |
623+
hir::ExprUnary(..) | hir::ExprYield(..) |
624624
hir::ExprMethodCall(..) | hir::ExprCast(..) |
625625
hir::ExprArray(..) | hir::ExprTup(..) | hir::ExprIf(..) |
626626
hir::ExprBinary(..) | hir::ExprWhile(..) |

src/librustc/middle/region.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1158,7 +1158,7 @@ impl<'tcx> Visitor<'tcx> for YieldFinder {
11581158
}
11591159

11601160
fn visit_expr(&mut self, expr: &'tcx hir::Expr) {
1161-
if let hir::ExprSuspend(..) = expr.node {
1161+
if let hir::ExprYield(..) = expr.node {
11621162
self.0 = true;
11631163
}
11641164

src/librustc/mir/mod.rs

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ pub struct Mir<'tcx> {
8585
/// Return type of the function.
8686
pub return_ty: Ty<'tcx>,
8787

88-
/// Suspend type of the function, if it is a generator.
89-
pub suspend_ty: Option<Ty<'tcx>>,
88+
/// Yield type of the function, if it is a generator.
89+
pub yield_ty: Option<Ty<'tcx>>,
9090

9191
/// Generator drop glue
9292
pub generator_drop: Option<Box<Mir<'tcx>>>,
@@ -134,7 +134,7 @@ impl<'tcx> Mir<'tcx> {
134134
visibility_scopes: IndexVec<VisibilityScope, VisibilityScopeData>,
135135
promoted: IndexVec<Promoted, Mir<'tcx>>,
136136
return_ty: Ty<'tcx>,
137-
suspend_ty: Option<Ty<'tcx>>,
137+
yield_ty: Option<Ty<'tcx>>,
138138
local_decls: IndexVec<Local, LocalDecl<'tcx>>,
139139
arg_count: usize,
140140
upvar_decls: Vec<UpvarDecl>,
@@ -150,7 +150,7 @@ impl<'tcx> Mir<'tcx> {
150150
visibility_scopes,
151151
promoted,
152152
return_ty,
153-
suspend_ty,
153+
yield_ty,
154154
generator_drop: None,
155155
generator_layout: None,
156156
local_decls,
@@ -268,7 +268,7 @@ impl_stable_hash_for!(struct Mir<'tcx> {
268268
visibility_scopes,
269269
promoted,
270270
return_ty,
271-
suspend_ty,
271+
yield_ty,
272272
generator_drop,
273273
generator_layout,
274274
local_decls,
@@ -571,7 +571,7 @@ pub enum TerminatorKind<'tcx> {
571571
},
572572

573573
/// A suspend point
574-
Suspend {
574+
Yield {
575575
/// The value to return
576576
value: Operand<'tcx>,
577577
/// Where to resume to
@@ -619,8 +619,8 @@ impl<'tcx> TerminatorKind<'tcx> {
619619
slice::ref_slice(t).into_cow(),
620620
Call { destination: None, cleanup: Some(ref c), .. } => slice::ref_slice(c).into_cow(),
621621
Call { destination: None, cleanup: None, .. } => (&[]).into_cow(),
622-
Suspend { resume: t, drop: Some(c), .. } => vec![t, c].into_cow(),
623-
Suspend { resume: ref t, drop: None, .. } => slice::ref_slice(t).into_cow(),
622+
Yield { resume: t, drop: Some(c), .. } => vec![t, c].into_cow(),
623+
Yield { resume: ref t, drop: None, .. } => slice::ref_slice(t).into_cow(),
624624
DropAndReplace { target, unwind: Some(unwind), .. } |
625625
Drop { target, unwind: Some(unwind), .. } => {
626626
vec![target, unwind].into_cow()
@@ -648,8 +648,8 @@ impl<'tcx> TerminatorKind<'tcx> {
648648
Call { destination: Some((_, ref mut t)), cleanup: None, .. } => vec![t],
649649
Call { destination: None, cleanup: Some(ref mut c), .. } => vec![c],
650650
Call { destination: None, cleanup: None, .. } => vec![],
651-
Suspend { resume: ref mut t, drop: Some(ref mut c), .. } => vec![t, c],
652-
Suspend { resume: ref mut t, drop: None, .. } => vec![t],
651+
Yield { resume: ref mut t, drop: Some(ref mut c), .. } => vec![t, c],
652+
Yield { resume: ref mut t, drop: None, .. } => vec![t],
653653
DropAndReplace { ref mut target, unwind: Some(ref mut unwind), .. } |
654654
Drop { ref mut target, unwind: Some(ref mut unwind), .. } => vec![target, unwind],
655655
DropAndReplace { ref mut target, unwind: None, .. } |
@@ -731,7 +731,7 @@ impl<'tcx> TerminatorKind<'tcx> {
731731
Return => write!(fmt, "return"),
732732
GeneratorDrop => write!(fmt, "generator_drop"),
733733
Resume => write!(fmt, "resume"),
734-
Suspend { ref value, .. } => write!(fmt, "_1 = suspend({:?})", value),
734+
Yield { ref value, .. } => write!(fmt, "_1 = suspend({:?})", value),
735735
Unreachable => write!(fmt, "unreachable"),
736736
Drop { ref location, .. } => write!(fmt, "drop({:?})", location),
737737
DropAndReplace { ref location, ref value, .. } =>
@@ -799,9 +799,9 @@ impl<'tcx> TerminatorKind<'tcx> {
799799
Call { destination: Some(_), cleanup: None, .. } => vec!["return".into_cow()],
800800
Call { destination: None, cleanup: Some(_), .. } => vec!["unwind".into_cow()],
801801
Call { destination: None, cleanup: None, .. } => vec![],
802-
Suspend { drop: Some(_), .. } =>
802+
Yield { drop: Some(_), .. } =>
803803
vec!["resume".into_cow(), "drop".into_cow()],
804-
Suspend { drop: None, .. } => vec!["resume".into_cow()],
804+
Yield { drop: None, .. } => vec!["resume".into_cow()],
805805
DropAndReplace { unwind: None, .. } |
806806
Drop { unwind: None, .. } => vec!["return".into_cow()],
807807
DropAndReplace { unwind: Some(_), .. } |
@@ -1507,7 +1507,7 @@ impl<'tcx> TypeFoldable<'tcx> for Mir<'tcx> {
15071507
visibility_scopes: self.visibility_scopes.clone(),
15081508
promoted: self.promoted.fold_with(folder),
15091509
return_ty: self.return_ty.fold_with(folder),
1510-
suspend_ty: self.suspend_ty.fold_with(folder),
1510+
yield_ty: self.yield_ty.fold_with(folder),
15111511
generator_drop: self.generator_drop.fold_with(folder),
15121512
generator_layout: self.generator_layout.fold_with(folder),
15131513
local_decls: self.local_decls.fold_with(folder),
@@ -1523,7 +1523,7 @@ impl<'tcx> TypeFoldable<'tcx> for Mir<'tcx> {
15231523
self.basic_blocks.visit_with(visitor) ||
15241524
self.generator_drop.visit_with(visitor) ||
15251525
self.generator_layout.visit_with(visitor) ||
1526-
self.suspend_ty.visit_with(visitor) ||
1526+
self.yield_ty.visit_with(visitor) ||
15271527
self.promoted.visit_with(visitor) ||
15281528
self.return_ty.visit_with(visitor) ||
15291529
self.local_decls.visit_with(visitor)
@@ -1646,7 +1646,7 @@ impl<'tcx> TypeFoldable<'tcx> for Terminator<'tcx> {
16461646
target,
16471647
unwind,
16481648
},
1649-
Suspend { ref value, resume, drop } => Suspend {
1649+
Yield { ref value, resume, drop } => Yield {
16501650
value: value.fold_with(folder),
16511651
resume: resume,
16521652
drop: drop,
@@ -1700,7 +1700,7 @@ impl<'tcx> TypeFoldable<'tcx> for Terminator<'tcx> {
17001700
Drop { ref location, ..} => location.visit_with(visitor),
17011701
DropAndReplace { ref location, ref value, ..} =>
17021702
location.visit_with(visitor) || value.visit_with(visitor),
1703-
Suspend { ref value, ..} =>
1703+
Yield { ref value, ..} =>
17041704
value.visit_with(visitor),
17051705
Call { ref func, ref args, ref destination, .. } => {
17061706
let dest = if let Some((ref loc, _)) = *destination {

src/librustc/mir/visit.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,7 @@ macro_rules! make_mir_visitor {
448448
cleanup.map(|t| self.visit_branch(block, t));
449449
}
450450

451-
TerminatorKind::Suspend { ref $($mutability)* value,
451+
TerminatorKind::Yield { ref $($mutability)* value,
452452
resume,
453453
drop } => {
454454
self.visit_operand(value, source_location);

src/librustc/traits/project.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1161,7 +1161,7 @@ fn confirm_generator_candidate<'cx, 'gcx, 'tcx>(
11611161
let gen_def_id = tcx.lang_items.gen_trait().unwrap();
11621162

11631163
// Note: we unwrap the binder here but re-create it below (1)
1164-
let ty::Binder((trait_ref, suspend_ty, return_ty)) =
1164+
let ty::Binder((trait_ref, yield_ty, return_ty)) =
11651165
tcx.generator_trait_ref_and_outputs(gen_def_id,
11661166
obligation.predicate.trait_ref.self_ty(),
11671167
gen_sig);
@@ -1170,7 +1170,7 @@ fn confirm_generator_candidate<'cx, 'gcx, 'tcx>(
11701170
let ty = if name == Symbol::intern("Return") {
11711171
return_ty
11721172
} else if name == Symbol::intern("Yield") {
1173-
suspend_ty
1173+
yield_ty
11741174
} else {
11751175
bug!()
11761176
};

src/librustc/traits/util.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -523,7 +523,7 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
523523
def_id: fn_trait_def_id,
524524
substs: self.mk_substs_trait(self_ty, &[sig.skip_binder().impl_arg_ty]),
525525
};
526-
ty::Binder((trait_ref, sig.skip_binder().suspend_ty, sig.skip_binder().return_ty))
526+
ty::Binder((trait_ref, sig.skip_binder().yield_ty, sig.skip_binder().return_ty))
527527
}
528528

529529
pub fn impl_is_default(self, node_item_def_id: DefId) -> bool {

src/librustc/ty/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2062,7 +2062,7 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
20622062
hir::ExprBox(..) |
20632063
hir::ExprAddrOf(..) |
20642064
hir::ExprBinary(..) |
2065-
hir::ExprSuspend(..) |
2065+
hir::ExprYield(..) |
20662066
hir::ExprCast(..) => {
20672067
false
20682068
}

src/librustc/ty/structural_impls.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -301,11 +301,11 @@ impl<'a, 'tcx> Lift<'tcx> for ty::adjustment::AutoBorrow<'a> {
301301
impl<'a, 'tcx> Lift<'tcx> for ty::GenSig<'a> {
302302
type Lifted = ty::GenSig<'tcx>;
303303
fn lift_to_tcx<'b, 'gcx>(&self, tcx: TyCtxt<'b, 'gcx, 'tcx>) -> Option<Self::Lifted> {
304-
tcx.lift(&(self.impl_arg_ty, self.suspend_ty, self.return_ty))
305-
.map(|(impl_arg_ty, suspend_ty, return_ty)| {
304+
tcx.lift(&(self.impl_arg_ty, self.yield_ty, self.return_ty))
305+
.map(|(impl_arg_ty, yield_ty, return_ty)| {
306306
ty::GenSig {
307307
impl_arg_ty,
308-
suspend_ty,
308+
yield_ty,
309309
return_ty,
310310
}
311311
})
@@ -635,14 +635,14 @@ impl<'tcx> TypeFoldable<'tcx> for ty::GenSig<'tcx> {
635635
fn super_fold_with<'gcx: 'tcx, F: TypeFolder<'gcx, 'tcx>>(&self, folder: &mut F) -> Self {
636636
ty::GenSig {
637637
impl_arg_ty: self.impl_arg_ty.fold_with(folder),
638-
suspend_ty: self.suspend_ty.fold_with(folder),
638+
yield_ty: self.yield_ty.fold_with(folder),
639639
return_ty: self.return_ty.fold_with(folder),
640640
}
641641
}
642642

643643
fn super_visit_with<V: TypeVisitor<'tcx>>(&self, visitor: &mut V) -> bool {
644644
self.impl_arg_ty.visit_with(visitor) ||
645-
self.suspend_ty.visit_with(visitor) ||
645+
self.yield_ty.visit_with(visitor) ||
646646
self.return_ty.visit_with(visitor)
647647
}
648648
}

src/librustc/ty/sty.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -631,7 +631,7 @@ impl<'a, 'tcx> ProjectionTy<'tcx> {
631631
#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, RustcEncodable, RustcDecodable)]
632632
pub struct GenSig<'tcx> {
633633
pub impl_arg_ty: Ty<'tcx>,
634-
pub suspend_ty: Ty<'tcx>,
634+
pub yield_ty: Ty<'tcx>,
635635
pub return_ty: Ty<'tcx>,
636636
}
637637

@@ -640,8 +640,8 @@ pub type PolyGenSig<'tcx> = Binder<GenSig<'tcx>>;
640640

641641
#[allow(warnings)]
642642
impl<'tcx> PolyGenSig<'tcx> {
643-
pub fn suspend_ty(&self) -> ty::Binder<Ty<'tcx>> {
644-
self.map_bound_ref(|sig| sig.suspend_ty)
643+
pub fn yield_ty(&self) -> ty::Binder<Ty<'tcx>> {
644+
self.map_bound_ref(|sig| sig.yield_ty)
645645
}
646646
pub fn return_ty(&self) -> ty::Binder<Ty<'tcx>> {
647647
self.map_bound_ref(|sig| sig.return_ty)

src/librustc_mir/build/expr/as_lvalue.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> {
121121
ExprKind::Return { .. } |
122122
ExprKind::Literal { .. } |
123123
ExprKind::InlineAsm { .. } |
124-
ExprKind::Suspend { .. } |
124+
ExprKind::Yield { .. } |
125125
ExprKind::Call { .. } => {
126126
// these are not lvalues, so we need to make a temporary.
127127
debug_assert!(match Category::of(&expr.kind) {

src/librustc_mir/build/expr/as_rvalue.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> {
239239
block = unpack!(this.stmt_expr(block, expr));
240240
block.and(this.unit_rvalue())
241241
}
242-
ExprKind::Suspend { value } => {
242+
ExprKind::Yield { value } => {
243243
let value = unpack!(block = this.as_operand(block, scope, value));
244244
let impl_arg_ty = this.impl_arg_ty.unwrap();
245245
block = unpack!(this.build_drop(block,
@@ -248,7 +248,7 @@ impl<'a, 'gcx, 'tcx> Builder<'a, 'gcx, 'tcx> {
248248
impl_arg_ty));
249249
let resume = this.cfg.start_new_block();
250250
let cleanup = this.generator_drop_cleanup(expr_span);
251-
this.cfg.terminate(block, source_info, TerminatorKind::Suspend {
251+
this.cfg.terminate(block, source_info, TerminatorKind::Yield {
252252
value: value,
253253
resume: resume,
254254
drop: cleanup,

0 commit comments

Comments
 (0)