-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-contributor-roadblockArea: Makes things more difficult for new or seasoned contributors to RustArea: Makes things more difficult for new or seasoned contributors to RustC-bugCategory: This is a bug.Category: This is a bug.
Description
Looking at the following method:
rust/compiler/rustc_middle/src/middle/region.rs
Lines 451 to 457 in 9310aff
/// 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. | |
pub fn yield_in_scope(&self, scope: Scope) -> Option<YieldData> { | |
self.yield_in_scope.get(&scope).cloned() | |
} |
Are the docs here correct that this "returns Some((span, expr_count))
"? From the code, it looks like the Some case returns a Some(YieldData)
. Looks like the docs should be updated to reflect the YieldData
type.
Metadata
Metadata
Assignees
Labels
A-contributor-roadblockArea: Makes things more difficult for new or seasoned contributors to RustArea: Makes things more difficult for new or seasoned contributors to RustC-bugCategory: This is a bug.Category: This is a bug.