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

Check for uninhabited types in sub-patterns (#12609) #36476

Closed
wants to merge 1 commit into from

Commits on Oct 6, 2016

  1. Check for uninhabited types in sub-patterns (rust-lang#12609)

    This alters the exhaustiveness-checking algorithm for pattern matches to
    avoid raising spurious errors about cases not being covered for
    uninhabited types.
    
    Specifically, the construct_witness function now returns an Option. If
    it sees that DUMMY_WILD_PAT is being used to match on an uninhabited
    type it returns None to indicate that there is no witness. We look for
    DUMMY_WILD_PAT specifically and not any wildcard pattern so that
    wildcard patterns explicitly written by the programmer continue to work
    without raising errors about unreachability.
    canndrew committed Oct 6, 2016
    Configuration menu
    Copy the full SHA
    a0026e6 View commit details
    Browse the repository at this point in the history