docs: Update rustc_middle::middle::region::ScopeTree
This corrects the return type in docs for yield_in_source method. Closes #80287.
This commit is contained in:
parent
0fe1dc6ac2
commit
f078f7cd64
@ -332,7 +332,7 @@ pub struct ScopeTree {
|
|||||||
pub struct YieldData {
|
pub struct YieldData {
|
||||||
/// The `Span` of the yield.
|
/// The `Span` of the yield.
|
||||||
pub span: Span,
|
pub span: Span,
|
||||||
/// The number of expressions and patterns appearing before the `yield` in the body plus one.
|
/// The number of expressions and patterns appearing before the `yield` in the body, plus one.
|
||||||
pub expr_and_pat_count: usize,
|
pub expr_and_pat_count: usize,
|
||||||
pub source: hir::YieldSource,
|
pub source: hir::YieldSource,
|
||||||
}
|
}
|
||||||
@ -449,9 +449,7 @@ impl ScopeTree {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Checks whether the given scope contains a `yield`. If so,
|
/// Checks whether the given scope contains a `yield`. If so,
|
||||||
/// returns `Some((span, expr_count))` with the span of a yield we found and
|
/// returns `Some(YieldData)`. If not, returns `None`.
|
||||||
/// the number of expressions and patterns appearing before the `yield` in the body + 1.
|
|
||||||
/// If there a are multiple yields in a scope, the one with the highest number is returned.
|
|
||||||
pub fn yield_in_scope(&self, scope: Scope) -> Option<YieldData> {
|
pub fn yield_in_scope(&self, scope: Scope) -> Option<YieldData> {
|
||||||
self.yield_in_scope.get(&scope).cloned()
|
self.yield_in_scope.get(&scope).cloned()
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user