-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
Remove unit #18752
Remove unit #18752
Conversation
👍 Been wanting to do this myself but I was afraid of the performance implications of going through interning for each call to Does the hash optimize out, at least? |
@@ -496,7 +496,7 @@ fn all_constructors(cx: &MatchCheckCtxt, left_ty: ty::t, | |||
ty::ty_bool => | |||
[true, false].iter().map(|b| ConstantValue(const_bool(*b))).collect(), | |||
|
|||
ty::ty_nil => | |||
ty::ty_tup(ref tys) if tys.is_empty() => | |||
vec!(ConstantValue(const_nil)), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't const_nil
be removed as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I kept it so that witnesses in non-exhaustive patterns would be more descriptive (i.e. () rather than _) but we can probably achieve that differently.
It still might be nice for pedagogical reasons to refer to unit as a kind of separate type in the documentation, since it's so common. (Internally though this is a great refactoring.) |
@pcwalton Agreed, the manual still refers to |
|
💃 |
[breaking-change] This will break any uses of macros that assumed () being a valid literal.
The exact version is rustc 0.13.0-dev (0b7b4f075 2014-11-16 22:36:50 +0000) and the relevant upstream issues are rust-lang/rust#18752 and rust-lang/rust#18976. Fixes gfx-rs#439.
The exact version is rustc 0.13.0-dev (0b7b4f075 2014-11-16 22:36:50 +0000) and the relevant upstream issues are rust-lang/rust#18752 and rust-lang/rust#18976. Fixes gfx-rs#439.
It was removed in <rust-lang/rust#18752>.
It was removed in <rust-lang/rust#18752>.
It was removed in <rust-lang/rust#18752>.
It was removed in <rust-lang/rust#18752>.
It was removed in <rust-lang/rust#18752>.
Closes #18614.