Skip to content

Clarify example for unconditional_recursion #14385

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

Merged

Conversation

alex-semenyuk
Copy link
Member

Clarify example for unconditional_recursion

changelog: none

@rustbot
Copy link
Collaborator

rustbot commented Mar 10, 2025

r? @Alexendoo

rustbot has assigned @Alexendoo.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Mar 10, 2025
@samueltardieu
Copy link
Contributor

Maybe you could also fix

/// This is a hard to find infinite recursion that will crash any code
/// using it.

by using something like "Infinite recursion in trait implementation will crash or loop forever, and are hard to find.". In the example, compiling in release mode will loop forever as the recursive call is transformed into a tail recursive one, while compiling in debug mode will crash because of a stack overflow.

@alex-semenyuk alex-semenyuk force-pushed the fix_example_unconditional_recursion branch 2 times, most recently from 315ba6a to 95545de Compare March 10, 2025 20:20
@alex-semenyuk
Copy link
Member Author

Maybe you could also fix

/// This is a hard to find infinite recursion that will crash any code
/// using it.

by using something like "Infinite recursion in trait implementation will crash or loop forever, and are hard to find.". In the example, compiling in release mode will loop forever as the recursive call is transformed into a tail recursive one, while compiling in debug mode will crash because of a stack overflow.

Done, thanks for pointing

@alex-semenyuk
Copy link
Member Author

r? Clippy

@rustbot
Copy link
Collaborator

rustbot commented Mar 21, 2025

Failed to set assignee to Clippy: cannot assign: response: {"message":"Not Found","documentation_url":"https://docs.github.com/rest/issues/assignees#add-assignees-to-an-issue","status":"404"}

Note: Only org members with at least the repository "read" role, users with write permissions, or people who have commented on the PR may be assigned.

@alex-semenyuk alex-semenyuk requested a review from Alexendoo March 22, 2025 16:21
@alex-semenyuk alex-semenyuk force-pushed the fix_example_unconditional_recursion branch from 95545de to 63e7815 Compare March 23, 2025 08:28
@Alexendoo Alexendoo added this pull request to the merge queue Mar 23, 2025
@Alexendoo
Copy link
Member

Thanks!

Merged via the queue into rust-lang:master with commit b27a2bb Mar 23, 2025
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants