Skip to content

Commit f078f7c

Browse files
committed
docs: Update rustc_middle::middle::region::ScopeTree
This corrects the return type in docs for yield_in_source method. Closes #80287.
1 parent 0fe1dc6 commit f078f7c

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

compiler/rustc_middle/src/middle/region.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ pub struct ScopeTree {
332332
pub struct YieldData {
333333
/// The `Span` of the yield.
334334
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.
336336
pub expr_and_pat_count: usize,
337337
pub source: hir::YieldSource,
338338
}
@@ -449,9 +449,7 @@ impl ScopeTree {
449449
}
450450

451451
/// 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`.
455453
pub fn yield_in_scope(&self, scope: Scope) -> Option<YieldData> {
456454
self.yield_in_scope.get(&scope).cloned()
457455
}

0 commit comments

Comments
 (0)