File tree 1 file changed +2
-4
lines changed
compiler/rustc_middle/src/middle
1 file changed +2
-4
lines changed Original file line number Diff line number Diff line change @@ -332,7 +332,7 @@ pub struct ScopeTree {
332
332
pub struct YieldData {
333
333
/// The `Span` of the yield.
334
334
pub span : Span ,
335
- /// The number of expressions and patterns appearing before the `yield` in the body plus one.
335
+ /// The number of expressions and patterns appearing before the `yield` in the body, plus one.
336
336
pub expr_and_pat_count : usize ,
337
337
pub source : hir:: YieldSource ,
338
338
}
@@ -449,9 +449,7 @@ impl ScopeTree {
449
449
}
450
450
451
451
/// Checks whether the given scope contains a `yield`. If so,
452
- /// returns `Some((span, expr_count))` with the span of a yield we found and
453
- /// the number of expressions and patterns appearing before the `yield` in the body + 1.
454
- /// If there a are multiple yields in a scope, the one with the highest number is returned.
452
+ /// returns `Some(YieldData)`. If not, returns `None`.
455
453
pub fn yield_in_scope ( & self , scope : Scope ) -> Option < YieldData > {
456
454
self . yield_in_scope . get ( & scope) . cloned ( )
457
455
}
You can’t perform that action at this time.
0 commit comments