Skip to content

Check type of fields when struct is matched against enum-like pattern - #5055

Closed
youknowone wants to merge 2 commits into
rust-lang:incomingfrom
youknowone:struct-match
Closed

Check type of fields when struct is matched against enum-like pattern#5055
youknowone wants to merge 2 commits into
rust-lang:incomingfrom
youknowone:struct-match

Conversation

@youknowone

Copy link
Copy Markdown
Contributor

Try field type pattern check instead of ad-hoc type check.
Fix#4849

sanxiynand others added 2 commits February 20, 2013 02:44
Previously check always succeeded because struct type was derived from
the matched expression, not the matched pattern.
Try field type pattern check instead of ad-hoc type check.
Fixrust-lang#4849
@youknowone

Copy link
Copy Markdown
ContributorAuthor

I attached a patch to #5046

@youknowone

Copy link
Copy Markdown
ContributorAuthor

I think @bors recognized wrong approval. Should I close this pull request and waiting for sanxyin's one to be merged first?

@sanxiyn

Copy link
Copy Markdown
Contributor

Do you have a test case for which new codes are needed?

@youknowone

Copy link
Copy Markdown
ContributorAuthor

I didn't found any case. I just tried similar implementation pattern as like other type nodes of match.

bors added a commit to rust-lang-ci/rust that referenced this pull request May 2, 2020
…tor-import, r=llogiq
Fix new lint generator import
Fix `rustc_lint` import path and add lifetimes to `LateLintPass` in `new_lint` command.
changelog: none
@youknowone
youknowone deleted the struct-match branch December 2, 2022 00:54
RalfJung added a commit to RalfJung/rust that referenced this pull request May 27, 2026
Sign up for freeto 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.

3 participants

@youknowone@sanxiyn@bors