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

Document early exit of method candidate search #1394

Closed

Conversation

Urhengulas
Copy link

Before it was unclear that Rust does not search through all candidates types, but exits the search as soon as it found a fitting method.

Before it was unclear that Rust does not search through all candidates types, but exits the search as soon as it found a fitting method.
@traviscross
Copy link
Contributor

Thanks @Urhengulas for submitting this. We agree this could be improved a bit, but on review, we weren't happy enough with the language here to merge it. It's hard to get this really right! We'll close this in favor of #1534. See also the other linked issues there.

adetaylor added a commit to adetaylor/reference that referenced this pull request Jan 30, 2025
This section of the reference has been oversimplistic for some time (rust-lang#1018
and rust-lang#1534) and various rewrites have been attempted (e.g. rust-lang#1394, rust-lang#1432).
Here's another attempt!

My approach here is:
* Stop trying to keep it short and concise
* Document what actually happens in the code, step by step

This does result in a long explanation, because we're trying to document
nearly 2400 lines of code in `probe.rs`, but doing otherwise feels
as though we'll continue to run into criticisms of oversimplification.

This rewrite documents the post-arbitrary-self-types v2 situation,
i.e. it assumes rust-lang/rust#135881 has
landed. We should not merge this until or unless that lands.

This PR was inspired by discussion in rust-lang#1699. If we go ahead with this
approach, rust-lang#1699 becomes irrelevant. There was also discussion at
rust-lang/cargo#15117 (comment)
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.

2 participants