Skip to content

Check rustc_middle docs for method return type #80287

Closed

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.

Activity

  1. LeSeulArtichaut commented on Dec 22, 2020

    @LeSeulArtichaut
    Contributor

    I think this doc comment is just outdated, feel free to file a PR updating it

  2. added
    A-contributor-roadblockArea: Makes things more difficult for new or seasoned contributors to Rust
    C-bugCategory: This is a bug.
    on Dec 22, 2020
  3. pierwill commented on Dec 22, 2020

    @pierwill
    ContributorAuthor

    @rustbot claim

  4. added a commit that references this issue on Dec 22, 2020
    67f8244
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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