Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check rustc_middle docs for method return type #80287

Closed
pierwill opened this issue Dec 22, 2020 · 2 comments · Fixed by #80302
Closed

Check rustc_middle docs for method return type #80287

pierwill opened this issue Dec 22, 2020 · 2 comments · Fixed by #80302
Assignees
Labels
A-contributor-roadblock Area: Makes things more difficult for new contributors to rust itself C-bug Category: This is a bug.

Comments

@pierwill
Copy link
Member

pierwill commented Dec 22, 2020

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.

@LeSeulArtichaut
Copy link
Contributor

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

@jyn514 jyn514 added A-contributor-roadblock Area: Makes things more difficult for new contributors to rust itself C-bug Category: This is a bug. labels Dec 22, 2020
@pierwill
Copy link
Member Author

@rustbot claim

GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this issue Dec 22, 2020
@bors bors closed this as completed in f078f7c Dec 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-contributor-roadblock Area: Makes things more difficult for new contributors to rust itself C-bug Category: This is a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants