Skip to content

std: Implement Iterator::size_hint method for Option iterators - #7656

Closed
ghost wants to merge 1 commit into
masterfrom
unknown repository
Closed

std: Implement Iterator::size_hint method for Option iterators#7656
ghost wants to merge 1 commit into
masterfrom
unknown repository

Conversation

@ghost

@ghost ghost commented Jul 8, 2013

Copy link
Copy Markdown

No description provided.

@thestinger

Copy link
Copy Markdown
Contributor

Landing as part of #7657.

@thestinger thestinger closed this Jul 8, 2013
@ghost
ghost deleted the option_iterator branch July 10, 2013 01:45
flip1995 pushed a commit to flip1995/rust that referenced this pull request Sep 28, 2021
Fix result order for `manual_split_once` when `rsplitn` is used

fixes: rust-lang#7656

changelog: Fix result order for `manual_split_once` when `rsplitn` is used
U007D pushed a commit to U007D/rust-mos that referenced this pull request Aug 21, 2026
7656: Implement constructor usage search for almost all items r=matklad a=Veykril

This PR moves the filering for enum constructors to the HIR, with this unprefixed variants as well as when the enum has been renamed via use will then still show up properly.
We now walk the ast of the `NameRef` up until we find a `PathExpr`(which also handles `CallExpr` for tuple-type structs and variants already) or a `RecordExpr`. For enum search we then take the `path` out of that expression and do a resolution on it to compare it with the definition enum.
With this PR we now support searching for all constructor literals, Unit-, Tuple- and Record-Structs, Unit-, Tuple- and Record-Variants as well as Unions.

There is one shortcoming due to how the search is triggered. Unit Variants constructors can't be searched as we have no position for it to kick off the search(since a comma doesn't have to exist for the last variant).

Closes rust-lang#2549 though it doesn't implement it as outlined in the issue since the reference kind was removed recently, though I believe the approach taken here is better personally.

Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
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