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

Report duplicate alt patterns as errors #706

Closed
wants to merge 3 commits into from
Closed

Conversation

jdm
Copy link
Contributor

@jdm jdm commented Jul 18, 2011

Being able to write something like

alt (value) {
_ { log "wheee!" }
_ { fail }
}

is silly. This branch doesn't have any tests included at the moment, however, because any non-trivial case butts up against the FIXME in trans_alt.rs that causes an error if any alt statement contains unreachable branches.

@marijnh
Copy link
Contributor

marijnh commented Jul 18, 2011

This is fine (I don't have time to fully review and pull just now), but at some point it'll have to be smarter than just duplicate patterns, and also detect stuff like this:

alt foo {
   _ { /* this catches everything */ }
   somevariant(?x) { /* unreachable */ }
}

Also, I'll make a note to fix the trans_alt FIXME this week. It shoiuldn't even be hard, I just forgot about it when I pushed that change.

@brson
Copy link
Contributor

brson commented Jul 19, 2011

jdm: I think marijnh has fixed that issue with translating unreachable branches. Can you add a test case?

@marijnh
Copy link
Contributor

marijnh commented Jul 25, 2011

I just pushed beab6ba , which does this in a more robust way (as described in my previous comment on this pull req).

@marijnh marijnh closed this Jul 25, 2011
keeperofdakeys pushed a commit to keeperofdakeys/rust that referenced this pull request Dec 12, 2017
Add IPV6_JOIN_GROUP and IPV6_LEAVE_GROUP to uclibc

Hello! Just some minor fixes so that net2 compiles correctly on uclibc
pdietl pushed a commit to pdietl/rust that referenced this pull request Apr 23, 2020
celinval added a commit to celinval/rust-dev that referenced this pull request Jun 4, 2024
The goal is to eventually consume rustc as is (issue rust-lang#42).

In this change, we moved the json file generations out of the linker
to the codegen method. The RMC behavior is still the same.
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.

3 participants