Skip to content

Check rustc_middle docs for method return type #80287

Closed
@pierwill

Description

@pierwill

Looking at the following method:

/// 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 RustC-bugCategory: This is a bug.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions