Skip to content

Extend dead code lint to detect more unused enum variants, rebased #25961

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
merged 2 commits into from
Jun 17, 2015

Conversation

sanxiyn
Copy link
Member

@sanxiyn sanxiyn commented Jun 2, 2015

Rebase of #21468.

Fix #25960.

@rust-highfive
Copy link
Contributor

r? @pcwalton

(rust_highfive has picked a reviewer for you, use r? to override)

@huonw
Copy link
Member

huonw commented Jun 2, 2015

Could you add a test like:

enum Foo { A, B }

fn bar() -> Foo {
    match Foo::A {
        Foo::A | Foo::B => Foo::B
    }
}

That is, ensuring that alternation doesn't get cause variants to count as unused.

@alexcrichton
Copy link
Member

r? @huonw

@rust-highfive rust-highfive assigned huonw and unassigned pcwalton Jun 2, 2015
@sanxiyn
Copy link
Member Author

sanxiyn commented Jun 3, 2015

Added a test.

@sanxiyn
Copy link
Member Author

sanxiyn commented Jun 10, 2015

Ping?

@sanxiyn
Copy link
Member Author

sanxiyn commented Jun 17, 2015

Another ping.

@huonw
Copy link
Member

huonw commented Jun 17, 2015

@bors r+

sorry for the delay

@bors
Copy link
Collaborator

bors commented Jun 17, 2015

📌 Commit 09a4d09 has been approved by huonw

@bors
Copy link
Collaborator

bors commented Jun 17, 2015

⌛ Testing commit 09a4d09 with merge 6169aa2...

@bors
Copy link
Collaborator

bors commented Jun 17, 2015

💔 Test failed - auto-mac-64-nopt-t

@sanxiyn
Copy link
Member Author

sanxiyn commented Jun 17, 2015

Failed in pretty. Fixed.

@sanxiyn
Copy link
Member Author

sanxiyn commented Jun 17, 2015

@bors r=huonw

@bors
Copy link
Collaborator

bors commented Jun 17, 2015

📌 Commit ae0716d has been approved by huonw

bors added a commit that referenced this pull request Jun 17, 2015
@bors
Copy link
Collaborator

bors commented Jun 17, 2015

⌛ Testing commit ae0716d with merge e7a5a1c...

@bors bors merged commit ae0716d into rust-lang:master Jun 17, 2015
@sanxiyn sanxiyn deleted the dead-variant-2 branch June 17, 2015 15:53
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.

CastError::RefToMutPtr is never constructed
6 participants