-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Fix handling of empty types in patterns. #38069
Merged
Merged
Commits on Jan 3, 2017
-
Start enabling empty types in pattern matching.
Remove the assumption at the start of is_useful that any suitably-long array of wildcard patterns is useful relative the any empty vector. Instead we just continue to recurse column-wise over the matrix. This assumption is false in the presence of empty types. eg. in the simplest case: let x: ! = ...; match x { // This pattern should not be considered useful by the algorithm _ => ... }
Configuration menu - View commit details
-
Copy full SHA for 9ad2044 - Browse repository at this point
Copy the full SHA 9ad2044View commit details -
Configuration menu - View commit details
-
Copy full SHA for bcdbe94 - Browse repository at this point
Copy the full SHA bcdbe94View commit details -
More pattern matching for empty types changes
Fix is_uninhabited for enum types. It used to assume that an enums variant's fields were all private. Fix MIR generation for irrefutable Variant pattern matches. This allows code like this to work: let x: Result<32, !> = Ok(123); let Ok(y) = x; Carry type information on dummy wildcard patterns. Sometimes we need to expand these patterns into their constructors and we don't want to be expanding a TyError into a Constructor::Single.
Configuration menu - View commit details
-
Copy full SHA for 9c5e86d - Browse repository at this point
Copy the full SHA 9c5e86dView commit details -
Improve error message, fix and add tests.
Changes the non-exhaustive match error message to generate more general witnesses.
Configuration menu - View commit details
-
Copy full SHA for 9ba9cd5 - Browse repository at this point
Copy the full SHA 9ba9cd5View commit details -
Configuration menu - View commit details
-
Copy full SHA for cfc45d5 - Browse repository at this point
Copy the full SHA cfc45d5View commit details -
Configuration menu - View commit details
-
Copy full SHA for d2827aa - Browse repository at this point
Copy the full SHA d2827aaView commit details -
Configuration menu - View commit details
-
Copy full SHA for 56f355c - Browse repository at this point
Copy the full SHA 56f355cView commit details -
Configuration menu - View commit details
-
Copy full SHA for f8c4d10 - Browse repository at this point
Copy the full SHA f8c4d10View commit details -
Add drain method to AccumulateVec/ArrayVec
You can now call .drain(..) on SmallVec, AccumulateVec and ArrayVec
Configuration menu - View commit details
-
Copy full SHA for 9482492 - Browse repository at this point
Copy the full SHA 9482492View commit details -
We now cache the inhabitedness of types in the GlobalCtxt. Rather than calculating whether a type is visibly uninhabited from a given NodeId we calculate the full set of NodeIds from which a type is visibly uninhabited then cache that set. We can then use that to answer queries about the inhabitedness of a type relative to any given node.
Configuration menu - View commit details
-
Copy full SHA for 7946597 - Browse repository at this point
Copy the full SHA 7946597View commit details -
Configuration menu - View commit details
-
Copy full SHA for 44a70f0 - Browse repository at this point
Copy the full SHA 44a70f0View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5ba61ed - Browse repository at this point
Copy the full SHA 5ba61edView commit details -
Configuration menu - View commit details
-
Copy full SHA for a157082 - Browse repository at this point
Copy the full SHA a157082View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4136ba0 - Browse repository at this point
Copy the full SHA 4136ba0View commit details -
Mostly just rename stuff. Visibility checks use DefIds rather than NodeIds now.
Configuration menu - View commit details
-
Copy full SHA for 9f83e96 - Browse repository at this point
Copy the full SHA 9f83e96View commit details -
Configuration menu - View commit details
-
Copy full SHA for 699b25f - Browse repository at this point
Copy the full SHA 699b25fView commit details -
Configuration menu - View commit details
-
Copy full SHA for e9ffc40 - Browse repository at this point
Copy the full SHA e9ffc40View commit details -
Configuration menu - View commit details
-
Copy full SHA for f947890 - Browse repository at this point
Copy the full SHA f947890View commit details -
Configuration menu - View commit details
-
Copy full SHA for c0cd145 - Browse repository at this point
Copy the full SHA c0cd145View commit details
Commits on Jan 4, 2017
-
Configuration menu - View commit details
-
Copy full SHA for 70b7bd9 - Browse repository at this point
Copy the full SHA 70b7bd9View commit details
Commits on Jan 5, 2017
-
Configuration menu - View commit details
-
Copy full SHA for 291c84a - Browse repository at this point
Copy the full SHA 291c84aView commit details -
Configuration menu - View commit details
-
Copy full SHA for 275c19d - Browse repository at this point
Copy the full SHA 275c19dView commit details
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.