Skip to content

Reserve 'yield' keyword #8560

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

Closed
wants to merge 1 commit into from
Closed

Conversation

lilyball
Copy link
Contributor

Rename task::yield() to task::deschedule().

Fixes #8494.

Rename task::yield() to task::deschedule().

Fixes rust-lang#8494.
bors added a commit that referenced this pull request Aug 18, 2013
Rename task::yield() to task::deschedule().

Fixes #8494.
@bors bors closed this Aug 19, 2013
Jarcho pushed a commit to Jarcho/rust that referenced this pull request Aug 29, 2022
Rework `only_used_in_recursion`

fixes rust-lang#8782
fixes rust-lang#8629
fixes rust-lang#8560
fixes rust-lang#8556

This is a complete rewrite of the lint. This loses some capabilities of the old implementation. Namely the ability to track through tuple and slice patterns, as well as the ability to trace through assignments.

The two reported bugs are fixed with this. One was caused by using the name of the method rather than resolving to the `DefId` of the called method. The second was cause by using the existence of a cycle in the dependency graph to determine whether the parameter was used in recursion even though there were other ways to create a cycle in the graph.

Implementation wise this switches from using a visitor to walking up the tree from every use of each parameter until it has been determined the parameter is used for something other than recursion. This is likely to perform better as it avoids walking the entire function a second time, and it is unlikely to walk up the HIR tree very much. Some cases would perform worse though.

cc `@buttercrab`

changelog: Scale back `only_used_in_recursion` to fix false positives
changelog: Move `only_used_in_recursion` back to `complexity`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Reserve 'yield' keyword
3 participants