Skip to content

Commit 67f8244

Browse files
Rollup merge of #80302 - pierwill:fix-80287, r=lcnr
docs: Update rustc_middle::middle::region::ScopeTree Correct return type in docs for [`yield_in_source`](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/middle/region/struct.ScopeTree.html#method.yield_in_scope) method. Closes #80287.
2 parents f711f3f + f078f7c commit 67f8244

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)