Skip to content

Make use of a binary operator's RHS type for LHS inference #21817

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

Merged
merged 2 commits into from
Feb 3, 2015

Conversation

edwardw
Copy link
Contributor

@edwardw edwardw commented Jan 31, 2015

For "symmetric" binary operators, meaning the types of two sides must be
equal, if the type of LHS doesn't know yet but RHS does, use that as an
hint to infer LHS' type.

Closes #21634

@rust-highfive
Copy link
Contributor

r? @nick29581

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

For "symmetric" binary operators, meaning the types of two side must be
equal, if the type of LHS doesn't know yet but RHS does, use that as an
hint to infer LHS' type.

Closes rust-lang#21634
@nrc
Copy link
Member

nrc commented Feb 2, 2015

@bors r+ 60fa1ff

alexcrichton added a commit to alexcrichton/rust that referenced this pull request Feb 2, 2015
For "symmetric" binary operators, meaning the types of two sides must be
equal, if the type of LHS doesn't know yet but RHS does, use that as an
hint to infer LHS' type.

Closes rust-lang#21634
@bors bors merged commit 60fa1ff into rust-lang:master Feb 3, 2015
@edwardw edwardw deleted the symmetric-binop branch February 3, 2015 08:15
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.

Type inference of floating point numbers through a comparison depends on the order of the operands
4 participants