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

Cleanup check_cast. Fixes #21554 #21606

Merged
merged 1 commit into from
Jan 27, 2015
Merged

Cleanup check_cast. Fixes #21554 #21606

merged 1 commit into from
Jan 27, 2015

Conversation

arielb1
Copy link
Contributor

@arielb1 arielb1 commented Jan 24, 2015

This also makes the cast error messages somewhat more uniform.

This also makes the cast error messages somewhat more uniform.
@rust-highfive
Copy link
Collaborator

r? @alexcrichton

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

@@ -3128,7 +3128,6 @@ pub fn type_is_scalar(ty: Ty) -> bool {
ty_bool | ty_char | ty_int(_) | ty_float(_) | ty_uint(_) |
ty_infer(IntVar(_)) | ty_infer(FloatVar(_)) |
ty_bare_fn(..) | ty_ptr(_) => true,
ty_tup(ref tys) if tys.is_empty() => true,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is () not scalar?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems to me that this might have non-local consequence, beyond just changing these error messages slightly, maybe just changing the internals of the cast checking would be more reliable?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unit structs aren't scalars. Unit enums aren't scalars. ((),) isn't a scalar. I checked the other places that use this function – they don't care.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, good; checking convinces me.

@alexcrichton
Copy link
Member

r? @huonw

@rust-highfive rust-highfive assigned huonw and unassigned alexcrichton Jan 25, 2015
@huonw
Copy link
Member

huonw commented Jan 26, 2015

@bors: r+ e724525

bors added a commit that referenced this pull request Jan 26, 2015
This also makes the cast error messages somewhat more uniform.
@bors
Copy link
Contributor

bors commented Jan 26, 2015

⌛ Testing commit e724525 with merge a637365...

@bors bors merged commit e724525 into rust-lang:master Jan 27, 2015
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.

5 participants