Skip to content

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

Merged
bors merged 2 commits into
rust-lang:masterfrom
sanxiyn:dead-variant-2
Jun 17, 2015
Merged

Extend dead code lint to detect more unused enum variants, rebased#25961
bors merged 2 commits into
rust-lang:masterfrom
sanxiyn:dead-variant-2

Conversation

@sanxiyn

@sanxiyn sanxiyn commented Jun 2, 2015

Copy link
Copy Markdown
Contributor

Rebase of #21468.

Fix #25960.

@rust-highfive

Copy link
Copy Markdown
Contributor

r? @pcwalton

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

@huonw

huonw commented Jun 2, 2015

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Member

r? @huonw

@rust-highfive rust-highfive assigned huonw and unassigned pcwalton Jun 2, 2015
@sanxiyn

sanxiyn commented Jun 3, 2015

Copy link
Copy Markdown
Contributor Author

Added a test.

@sanxiyn

sanxiyn commented Jun 10, 2015

Copy link
Copy Markdown
Contributor Author

Ping?

@sanxiyn

sanxiyn commented Jun 17, 2015

Copy link
Copy Markdown
Contributor Author

Another ping.

@huonw

huonw commented Jun 17, 2015

Copy link
Copy Markdown
Contributor

@bors r+

sorry for the delay

@bors

bors commented Jun 17, 2015

Copy link
Copy Markdown
Collaborator

📌 Commit 09a4d09 has been approved by huonw

@bors

bors commented Jun 17, 2015

Copy link
Copy Markdown
Collaborator

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

@bors

bors commented Jun 17, 2015

Copy link
Copy Markdown
Collaborator

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

@sanxiyn

sanxiyn commented Jun 17, 2015

Copy link
Copy Markdown
Contributor Author

Failed in pretty. Fixed.

@sanxiyn

sanxiyn commented Jun 17, 2015

Copy link
Copy Markdown
Contributor Author

@bors r=huonw

@bors

bors commented Jun 17, 2015

Copy link
Copy Markdown
Collaborator

📌 Commit ae0716d has been approved by huonw

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

bors commented Jun 17, 2015

Copy link
Copy Markdown
Collaborator

⌛ Testing commit ae0716d with merge e7a5a1c...

@bors

bors commented Jun 17, 2015

Copy link
Copy Markdown
Collaborator

@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