diff options
| author | pierwill <pierwill@users.noreply.github.com> | 2020-12-22 10:50:41 -0800 |
|---|---|---|
| committer | pierwill <pierwill@users.noreply.github.com> | 2020-12-22 10:57:05 -0800 |
| commit | f078f7cd64302b9a3f29e11387fd0f7a547fa60c (patch) | |
| tree | 40e385b4ac527f8e2803db87d08e16e50fe5b03d | |
| parent | 0fe1dc6ac214d443369134177940b4d0111e1df6 (diff) | |
| download | rust-f078f7cd64302b9a3f29e11387fd0f7a547fa60c.tar.gz rust-f078f7cd64302b9a3f29e11387fd0f7a547fa60c.zip | |
docs: Update rustc_middle::middle::region::ScopeTree
This corrects the return type in docs for yield_in_source method. Closes #80287.
| -rw-r--r-- | compiler/rustc_middle/src/middle/region.rs | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/compiler/rustc_middle/src/middle/region.rs b/compiler/rustc_middle/src/middle/region.rs index d060549ca81..eb48198991c 100644 --- a/compiler/rustc_middle/src/middle/region.rs +++ b/compiler/rustc_middle/src/middle/region.rs @@ -332,7 +332,7 @@ pub struct ScopeTree { pub struct YieldData { /// The `Span` of the yield. 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 source: hir::YieldSource, } @@ -449,9 +449,7 @@ impl ScopeTree { } /// Checks whether the given scope contains a `yield`. If so, - /// returns `Some((span, expr_count))` with the span of a yield we found and - /// 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. + /// returns `Some(YieldData)`. If not, returns `None`. pub fn yield_in_scope(&self, scope: Scope) -> Option<YieldData> { self.yield_in_scope.get(&scope).cloned() } |
